AppleScript is a proprietary programming language in Mac OS X to control and exchange data with applications.

learn more… | top users | synonyms (2)

3
votes
1answer
622 views

Hide windows in current desktop (Lion)

I'd like to make a keyboard shortcut that hides all windows on the current desktop, while ignoring windows on other desktops. Is this possible using Applescript?
2
votes
3answers
5k views

How do I create an AppleScript that will quit an application at a specific time and then put the computer to sleep?

I've been toying around with AppleScript and Automator to get this thing to work, but I just can't seem wrap my head around it. If anyone could show me an example or give me some tips on how I can set ...
1
vote
2answers
49 views

Applescript to automatically add .noindex extension to a file?

I'm interested in excluding certain files from Spotlight, and it was suggested to add the .noindex extension. I'd like to automate this. How is it possible to do via Applescript?
2
votes
2answers
704 views

Applescript to kill open applications and log out user after 30 min. of inactivity

I'm looking for a way to automatically log off a user after 30 minutes of inactivity, as well as close all open applications. As of now, there is really only one user to deal with. I'd prefer an easy ...
1
vote
1answer
211 views

Notification Center message via AppleScript/osascript — specify an application name and icon

When sending a notification to OS X's Notification Center via AppleScript's osascript, such as in: osascript -e 'display notification "Finished that long running task." with title "Finally!"' The ...
1
vote
1answer
29 views

Pausing workflow until action complete

I have Hazel set up on a media server to automatically add files to specific iTunes playlists based on a text tag in the directory name. Several users will send us individual files or directories ...
0
votes
2answers
98 views

Is there a way to extract contents from AppleScript file without using AppleScript editor?

I have a bunch of applescript files I need to run but some that were running yesterday are not running today. Applescript is showing me this beautiful message. When this message is shown, console ...
1
vote
2answers
84 views

Saving applescripts as scripts versus text

When saving a script in Applescript Editor, it defaults to the Script file format. The file produced is binary and cannot be indexed by Spotlight. So if I want to search a script based on a word used ...
0
votes
1answer
24 views

How to merge lecture notes from the web into a single PDF file

I have some lecture notes which are located at: www.mywebsite.com/Lecture1.pdf www.mywebsite.com/Lecture2.pdf etc In Automator I currently have done the following: Get specified URLs Download ...
0
votes
2answers
26 views

Prompting user for input on locking screen

I'm relatively new to OSX (running Mavericks), but my goal is to create a script that reminds me to take notes on the day's work. The script will ideally: run upon the user clicking 'Login window' ...
1
vote
0answers
230 views

Applescript / Automator - Pass variables between them

I have a question about how to pass the applescript input from one computer to another computer's automator input (I created it as a program). I've created the script below to ask for the filename and ...
2
votes
1answer
327 views

How can I permanently force Xerox secure printing?

My clients are printing direct to a network printer (no print server). Xerox have confirmed that the Secure Print Only option is only available in Windows, so I am looking at editing .plists, ...
1
vote
2answers
312 views

How can Growl trigger an shell script or AppleScript (NOT vice versa!)

When a Growl notification gets issued I want to trigger an AppleScript. I had a look at the "Actions" in the Growl preferences, and you can trigger things like an email or a text-to-speech call, but ...
0
votes
1answer
159 views

How to fix my Applescript plugins for the Contacts application that are no longer available since 10.9 Mavericks upgrade?

I have got 5 scripts listed in ~/Library/Address Book Plug-Ins/ SkypeABDialer.bundle SkypeABSMS.bundle TelephoneAddressBookPhonePlugIn.bundle TelephoneAddressBookSIPAddressPlugIn.bundle Dial with ...
0
votes
1answer
32 views

How to “archive” iTunes files with all metadata?

I recently decided to do a big cleanup of my iTunes library. I am low on disk space and have quite a bit of music that I haven't listened to since I was a much younger man, but I can't bring myself to ...
1
vote
1answer
937 views

AppleScript to close “About this Mac” window

How could I use AppleScript code to close the window named "About this Mac" (A propos de ce Mac in French). I need an AppleScript for this because I use Dragon Dictate 3 commands. I am handicapped and ...
1
vote
0answers
28 views

Click in finder vs “open -a” on command line

I have a file type (.mxl -- compressed MusicXML) which if I double click in Finder opens properly in my .mxl reader (Finale 2014.app) but which if I call "open file.mxl" or "open -a ...
1
vote
0answers
60 views

Rename iMessage group with AppleScript

While the new iOS 8 group naming can be great, if the people in the group aren't very mature it can be...very not great. How would I go about renaming a group in Messages.app with AppleScript? I ...
0
votes
0answers
18 views

How to react to click on a notification?

So I've got my applescript script throwing up notifications. And that's awesome. Now can I control what happens when the user clicks on it? Ideally I want it to just open a file, but can't surmise ...
1
vote
2answers
234 views

Script to check Software Version

Hi i'm tryin to write a script to check software version. I want to pass my own variables, which are name of the Application and Version. Here's a copy. It's not working for me currently... i'm a ...
0
votes
0answers
29 views

Run kinit as AppleScript promting for network username and password

I need to develop a small app (currently using AppleScript to do it) that I can send to users to run a "kinit" shell script command. This is on machines that are not bound to the domain, but needs to ...
3
votes
1answer
930 views

System-Preferences Applescript using osascript cannot select its window

This AppleScript (based on an answer in a MacWorld form) will tell me whether or not Screen Sharing is enabled: tell application "System Preferences" reveal pane "com.apple.preferences.sharing" ...
0
votes
1answer
25 views

How to run a script on login whilst being hidden

I have an applescript (scpt) script that I would like to run on login of a user. I would like the script not be visible in the dock, menu bar, etc. (This would probably mean running it in the ...
0
votes
1answer
268 views

How to trigger Notification Centre notification from JavaScript? [closed]

The other question asks the same but using AppleScript. Apple introduced JavaScript as a new language for Automation in OS X 10.10.
4
votes
2answers
120 views

Run an AppleScript that requires keystrokes while the screen is locked?

I've got a very simple AppleScript whose job it is to type some words into a text box. tell application "TextEdit" activate end tell delay 0.2 tell application "System Events" keystroke "Hello ...
0
votes
0answers
121 views

Applescript automate to click button on Safari webpage

Trying to do some automation in safari here using applescript, keep getting error, please help! Here's the DOM Tree codes <div id="sc1789" class="tvb4 sc-view" style="left: 0px; right: 0px; top: ...
0
votes
0answers
74 views

Running an apple script repeatedly and stopping if the application unexpectedly quits

I've been searching for hours for a solution to this but have been unable to find anything. Currently I have the following applescript: repeat set core_is_running to is_running("MyApp") if ...
0
votes
0answers
35 views

apple script to copy Items to usb

i REALLY need a apple script that would copy items(files,folders everything so whatever is in this folder must be copied) of a folder in my documents to a usb folder but only when the usb is mounted ...
3
votes
1answer
46 views

Variable not defined not sure why

For some reason "the name of thePath" comes up as not defined by my automator workflow. on run {input, parameters} tell application "Finder" set thePath to the (first item of the input) ...
0
votes
0answers
77 views

transfer label from afp to smb

Is a possibility known to transfer label from afp to smb (Server files/directorys)? When changing from afp to smb all tags are disabled. Does anyone have a script? I've found on the subject: ...
0
votes
0answers
25 views

What is required to make a bookmark that creates calendar events from values on a web page?

So I have a page that has days and times on it, and I want to know how to make a script or bookmarked script that will find these values and put them into my calendar. Any idea?
-2
votes
1answer
84 views

error “Can’t get button returned of \”C\“.” number -1728 from button returned of “C”

set buttonChoice to (display dialog "Play game?" buttons {"Yes", "No"} with title "Play?") if button returned of buttonChoice = "No" then return "No" end if repeat set levelnum to text returned of ...
1
vote
1answer
2k views

need to script connection to telnet and send commands to remote device with no user input

Ok I need some help making a script that will connect to a server and send 2 commands Ideally I would have telnet 192.168.2.230 9993 and once it logs in (no user name or password required - the ...
0
votes
3answers
108 views

How do I determine which application launched automator service?

Is there a way to determine which application launched a Automator Service? The idea is to check the app that launched the service, with a shell/apple script and react differently depending which ...
1
vote
0answers
41 views

Automatically saving message attachments to a mailbox

I subscribe to a rather odd mailing list, through which I receive emails to which further emails are attached (in eml format). I want to archive those attachments into a dedicated mailbox, all within ...
0
votes
1answer
31 views

iTunes: get selected mobile apps with AppleScript

I fear I already know the answer to this one, but is there any way to access the locally-stored Mobile Applications in an iTunes library using AppleScript? The selection property appears to not ...
2
votes
0answers
22 views

Applescript Editor's compiler erratic behaviour

I've just come across some bizarre behaviour in the Applescript Editor (Snow Leopard - 10.6.8) that I was wondering if anyone knows how to get around it. Basically, one second a statement will ...
2
votes
3answers
686 views

How to add a Safari toolbar button that runs an AppleScript

How do I add a button to the Safari toolbar that, when clicked, executes a given AppleScript?
0
votes
1answer
71 views

How to change filepath structure using automator (windows to mac)?

I use a mac at work and people send me windows file paths all day. Does anyone know how to convert the filepath using applescript in an automator so I can right click in an email and then open it? ...
0
votes
3answers
161 views

How can I set the default browser depending on time of day?

I have a MacBook Pro from work. To keep my browsing history separate, I use 2 different browsers. (Chrome = Work, Safari = Fun) I want to make my default browswer Chrome while at work (9 am to 6pm), ...
0
votes
1answer
163 views

Get the process id of the app, which called the service

I have an service in automator, which is binded to the Safari ,no input option. Now is there any way for the service in automator to get the process id of the Safari, which called it ? New to ...
0
votes
1answer
464 views

Applescript date manipulation to get multiple formats

I need to get a date (month, day, year) in multiple different formats for each part. So, for January 2, 1999 I need: the month as January and Jan and 01 and 1 the day as 2 and 02 the year as 1999 ...
1
vote
0answers
41 views

Sync applescript calls.

I'm very new to applescripting and I have the following code: tell application "Safari" tell document 1 do JavaScript "document.getElementById(\"binaryFilePath\").click()" end tell ...
0
votes
3answers
1k views

How Can I Create a Multi-Line Input Dialog using Applescript?

How can I create a multiline text input dialog using Applescript? Creating a single line dialog is simple...
2
votes
1answer
204 views

Can only run AppleScript from Automator

I have the following AppleScript which toggles the scroll direction on the trackpad: tell application "System Preferences" activate set current pane to pane "com.apple.preference.trackpad" ...
2
votes
1answer
71 views

Applescript question for copying files

I wrote a script to copy files from an SD Card to a Thunderbolt Hard Drive. I wanted the action to automatically do all of this in a single shelled applescript under an automator action. When I ...
1
vote
0answers
41 views

How can I start a Hangouts phone call with Applescript/Terminal?

I want to initiate a Google Hangouts phone call with Applescript. Hangouts has an AS dictionary, but with only the default suites. I want to emulate opening the Hangouts popup, typing in a phone ...
1
vote
0answers
312 views

Set iMessage sender in applescript for a new message

Applescript allows you to send messages via iMessage and the command line, ie) http://stackoverflow.com/questions/11812184/how-to-send-an-imessage-text-with-applescript-only-in-provided-service Is ...
1
vote
2answers
916 views

Opening new Terminal.app window/tab with a certain profile from command-line or AppleScript?

When I login to my Mac, I want to automatically open a new Terminal.app window with a certain profile, say Monitor, that has a startup command and several appearance settings. I thought it would be ...
1
vote
2answers
1k views

Applescript to type text, followed by a modifier key combo?

I want to use TextExpander to activate when I type the specific text "attached", and have the AppleScript type out the word "attached" (since TextExpander will remove it), and then invoke the ...