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

learn more… | top users | synonyms (3)

0
votes
2answers
278 views

How do I copy the location of a track to the “Comments” section in iTunes?

I dont understand why this is not working. If anybody knows how to resolve this issue: tell application "iTunes" copy location of track 1 of playlist "Test" to Comments end tell Applescript ...
0
votes
2answers
608 views

Display a notification with AppleScript

I would like to trigger a notification with AppleScript. I have seen How can I trigger a Notification Center notification from an AppleScript or shell script? but I would like to have a native ...
2
votes
2answers
565 views

How can I reproduce the Finder sort order without asking Finder to sort for me?

I work with a large collection of mostly-text files subdivided by series, periodically mirroring them from an upstream repository and repackaging them using a shell script from a slightly chaotic ...
3
votes
1answer
458 views

Applescript - Connection is invalid

I have an application for mac and I use the following applescript code (exported as an AS app) to start that app periodically: on idle tell application "System Events" tell application ...
0
votes
1answer
317 views

Set Specific Podcasts to Show as TV Shows in iTunes, using AppleScript

I'm using on online TV recorder to record TV shows. Those recordings are downloaded as a podcast to iTunes. My following Applescript should just grab those podcasts, update some info fields and ...
0
votes
2answers
522 views

How to get the path of the selected Image in Adobe Bridge via Applescript?

I am trying to get the parent file path of a selected image thumbnail in Adobe Bridge CS5.1 to pass it on to a shell script. An Applescript wraps a tiny javascript command in command like this: set ...
1
vote
2answers
420 views

How to suppress the “Run or quit” dialog when launching an applescript?

I am having the same basic problem as in this question: AppleScript app started prompting to run or quit. How can I disable this? However, in my case the "Startup Screen" option is definitely NOT ...
4
votes
5answers
2k views

How can I remove leading/trailing whitespace from filenames in Automator?

My wife tediously renames files all the time when storing on her backup external storage, so I investigated using automator to do this for her. I now have an automator folder where she just drops the ...
1
vote
1answer
195 views

How to run Excel on headless Mac?

I'd like to run applescript to control Excel on a headless Mac. I want to do it from the command line via ssh, and I cannot - there is no display to run applescript on, so osascript throws an error. ...
3
votes
3answers
4k views

Software to record and playback mouse movement/clicks and keyboard presses?

I was wondering if there was any software out there that could record mouse/keyboard input and allow you to play back the input that was made? I've tried using Automator but for some reason it's not ...
8
votes
4answers
862 views

Copying formatted text from a web page to an Applescript input dialog

I have an Applescript which - simplified - looks like this: ... display dialog "foo" default answer "" ... One of the users of this script runs Lion. Whenever he tries to copy/paste a string to the ...
4
votes
1answer
4k views

Using UI scripting to enter text in a file dialog

I am very, very new to using AppleScript. I need to enter text into the search box. So far the script looks like this: on run {input, parameters} tell application "myApplication" to activate ...
1
vote
3answers
797 views

Make a screen-shot and upload with a script

I am not very good with AppleScript but I would imagine this is something quite easy for the AppleScript guru out there, I am looking to make a screenshot of a region like with doing Apple-Shift-s and ...
2
votes
1answer
218 views

AppleScript SL to ML Issue (compatibility error?)

I've written the following script in Applescript in Snow Leopard, and I tried to use it in Mountain Lion, but to no avail (doesn't work). The script watches a folder for added files, and if the ...
1
vote
2answers
1k views

Automate PDF actions

To improve my paperless workflow, I'm looking to achieve the following, potentially using automator / applescript. I need to be able to run it using Hazel, or as a folder action (not run manually): ...
0
votes
1answer
669 views

Script to turn flagged emails into reminders

I am looking for a script that will recognize when an email is flagged and then turn it into a Reminder using the Reminders app.
4
votes
1answer
4k views

Is there an Automator action to create Keynote presentation from text file?

I need to import a text file (consisting of subtitles) into a Keynote presentation. I need to turn each subtitle into a single slide, interspersed with blank (black) slides. I'd like to create an ...
1
vote
2answers
597 views

AppleScript “Open With…” icon

I've written an AppleScript app that I use to open certain files with (it sends them to Vim in the Terminal). I'd like to set all my .Tex files to automatically open with this app. The problem is ...
6
votes
1answer
366 views

Any way to get the “Open With…” list via AppleScript?

I want to create an AppleScript that gets the Finder selection and displays a list of applications that are capable of opening it. In other words, is there any way to get the list of apps that ...
0
votes
1answer
394 views

Detect the TV Show, Season and Episode from a mp4 file in applescript

Assuming I have an MP4/M4V file of a TV show. The file has the necessary metadata so it can be imported into iTunes and you'll see the all the relevant information. Using AppleScript, one can extract ...
1
vote
1answer
1k views

AppleScript to compare contacts in two groups and remove duplicate from one group

I want to create an AppleScript for Apple's Address Book (Contacts) app that will look at two Groups, and if a contact is in one Group, it will remove it from the other Group. Specifically, I add ...
1
vote
1answer
1k views

Insert images into Pages document using AppleScript

I'm trying to automate the construction of a document, and am looking for a way to insert images into a Pages document with AppleScript. For example: tell application "Pages" make new document ...
6
votes
1answer
764 views

Toggle Finder sort order with AppleScript under Lion 10.7?

For years I've been using this AppleScript to toggle the sort order of a Finder window: if sort direction of column id size column of list view options of window 1 is normal then set sort ...
0
votes
1answer
108 views

Applescript won't play movie when waking from sleep

I have the following AppleScript, which is triggered by iCal to act as my alarm clock: set musicPath to the path to me as text set musicPath to text items 1 thru -12 of musicPath as text set ...
1
vote
1answer
732 views

How do I change some text in an OmniGraffle document via AppleScript without changing the text's styling?

If I create an OmniGraffle document, add a text box with “Test” in red in size 28, I can change the text with this snippet of AppleScript: tell application "OmniGraffle Professional 4" set text ...
2
votes
1answer
325 views

How do I enable “Announce the time” programmatically?

The "Date & Time" System Preferences pane has an option to "Announce the time". I'd like to be able to turn on this preference option by invoking a shell script. Is this possible? (It's fine if ...
2
votes
1answer
1k views

Why won't my AppleScript run as a Service?

I have a simple AppleScript that works exactly as expected when run on its own, ether as an app, directly from within ScriptDebugger or Script Editor, or as an element of an Automation from within ...
3
votes
6answers
10k views

Mail.app in Lion - is there a way to create tasks from email?

I'm not sure if I haven't seen that in earlier versions of Mail.app, but I would really love to have the ability to create a task in iCal from an email - and that this task could link to the original ...
7
votes
2answers
6k views

How can I bring a window to frontmost without focusing it using Applescript in OS X 10.8

I want to bring a window (QuickTime for example) to frontmost, without focusing it. I can do it in OS X 10.7 using the following code in Applescript. tell application "System Events" set visible ...
5
votes
2answers
894 views

Is there a way to have AppleScript output displayed in the menubar?

Before reading further: I know about butler and similar programs. I am looking for a BUILT-IN way to do this without a third party app. Anyway, I wrote an AppleScript that runs a shell command. I ...
1
vote
2answers
2k views

How do i pass variables' values between subsequent applescript runs? (persistent value between script executions)

I have an applescript that I run like a cron job. Within this applescript, i have variables that act like boolean switches (i.e. on/off values). With subsequent runs, depending on whether the boolean ...
0
votes
1answer
1k views

Trying to use applescript to launch cmd line 3 scripts in new tabs

I'm trying to launch 3 tabs and run a script in each with applescript. So far I havent been able to get this done. Currently I have: tell application "Terminal" activate do script "ping ...
3
votes
1answer
625 views

Does applescript's 'delay' function work when the computer is asleep?

I'm trying to make an alarm clock for myself with AppleScript after my old (physical) one crapped out. I've got a script that'll schedule a pmset wakeup at the requisite time. There's just the matter ...
0
votes
2answers
1k views

How do I display a hyperlink with an AppleScript?

I am trying to get a URL via AppleScript, then displaying it as a clickable link via a window. How do I do this? (if I need to use Xcode for this, please add the answer, but provide detailed ...
1
vote
1answer
419 views

AppleScript to tell Adobe Reader to close a certain document

Adobe Reader has N documents open. One of them has a known filepath and title and it needs to be programmatically closed. How to go about doing this in AppleScript? Specifically, how can I: Talk to ...
0
votes
1answer
175 views

Applescript to monitor terminal changes

I want to be able to check if a word appears in a terminal window running a java application and then display a notification. Any ideas?
3
votes
1answer
431 views

Finder list view, change column with to optimal with using AppleScript

I'm trying to create an AppleScript script that resizes the columns of Finder's list view (e.g. Name, Size …) to their optimal width (i.e. the minimum width where all text in the column is visible) on ...
11
votes
5answers
3k views

How can I automatically launch an application whenever the Mac goes idle?

Is there a way to launch an application, such as Transmission, every time the computer goes idle (instead of sleeping)?
2
votes
3answers
782 views

Applescript app to shut down Mathematica at a specific time of day

I have the following workflow that I need to execute on a daily basis for a period of days: The computers start at a specified time, Mathematica and a specific Mathematica notebook launch and ...
1
vote
1answer
374 views

An iTunes Applescript that appends to tag only when it doesn't match part of the tag string?

I'm trying to find a way to add a keyword or group of words/tags/strings to a set of selected iTunes tracks if they haven't been added. A use-case would be to add extra metadata in a comment such as ...
4
votes
2answers
479 views

Is there an AppleScript or Automator action to quickly edit Info for Video in iTunes?

I ripped the DVD set of a television series to my iMac. But now, the filenames are weird and there is no meta info. In Automator, I see there is an action to edit Info for a song. That's great, but ...
1
vote
2answers
216 views

Open a folder in default browser

I have many web projects that I develop on the localhost. Normally to get to these one has to navigate from the root directory or bookmark the url. I want to be able to open an OS directory/folder in ...
1
vote
1answer
987 views

Deleting all songs in a given iTunes playlist using Applescript

I'm working on a script to manage my "queue" playlist in iTunes and wanted an easy and fast way to quickly delete all songs in that playlist. Applescript seemed the best option and I created a little ...
1
vote
2answers
3k views

How do I write an AppleScript which auto reconnects to Wi-Fi?

Sometimes I need to download very big files from the internet using torrents (I'm using Transmission) and the Wi-Fi always drops. I bought several routers and modems and none of them work. I've been ...
1
vote
2answers
3k views

How do I run an OS X command script on remote Xserves from a desktop OS X script?

The answer to an earlier question, Access and control home office network, iMacs, and Xserves, left me with a new problem. To review, I have a computing environment comprised of: 27" iMac with dual ...
5
votes
3answers
3k views

Where is the date and time preference data saved on Mac?

I need to check programmatically whether Set Date and Time automatically is checked or not on a Mac System Preferences. I didn't find any .plist file that contained this information, can anybody tell ...
1
vote
1answer
175 views

Forwarding a mail as a fax using Applescript and Mail

I am using the Mac's fax function and that works just great. I would, however, like to make an Applescript that gets called from a Mail rule. For example, when the Subject is something like: ...
1
vote
1answer
137 views

Toggling page views in Skim

When right-clicking on a document in skim there are two very useful options: Single Page (good for presentations) Single Page Continuous (suitable for reading) Is there a way to define a shortcut ...
0
votes
1answer
328 views

AppleScript and Growl: How to choose the display style?

I'm using AppleScript and calling Growl notifications and I notice that it ignores my choice of using Bezel as my system default style. It only changes if I manually change it in Growl's preferences. ...
4
votes
1answer
463 views

Applescript array of applications

I have a script that reload the active tab of an open browser, but I want it to do with all opened browsers. Is there a way to make a list/array and use it in this code? This code works with one ...