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

learn more… | top users | synonyms (2)

5
votes
3answers
2k 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 ...
5
votes
1answer
365 views

How to Listen For an Application Launch Event on Mac OS X

I wrote an AppleScript to mount a bundled sparse disk image. I want this script to be executed exactly when Time Machine launches. I can check if Time Machine is running with on idle statement, on ...
5
votes
2answers
674 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 ...
5
votes
0answers
104 views

AppleScript to make the preview image become the master in Aperture library?

Recently I accidently deleted the folder that contained most of my Aperture library (I didn't think they were refenced, I assumed they were all in my library file, but unfortunately this was not true) ...
4
votes
3answers
408 views

How can I make this Apple Script shorter? (quitting multiple apps via tell)

I want to edit a part of an Apple Script to quit various applications at once: tell application "TweetDeck" quit end tell tell application "Google Chrome" quit end tell Over all there are ...
4
votes
1answer
2k views

How do I find out the applescript commands available for a particular app?

I'm trying to find out if I can get iTunes to do something complex, but don't know what can be scripted. Is there a way to find out what applescript commands an app will respond to?
4
votes
2answers
5k views

How do I use AppleScript to reveal a file in Finder from its POSIX path?

I'm trying to create an AppleScript snippet that locates the current random wallpaper and reveals it in Finder. I have the following snippet which finds the current wallpaper's POSIX path as a string: ...
4
votes
2answers
461 views

Where can I access official AppleScript documentation?

Is there any official AppleScript documentation? If so, where can I find it?
4
votes
5answers
5k views

How to run Applescript on Disk mount

I want to run an Applescript when I mount a specific disk. It isn't if the script is located on the disk or not, it should just run when OS X mounts the disk. I tried to accomplish this with folder ...
4
votes
1answer
86 views

How do I close the source of an AppleScript application?

When saving an AppleScript as an application, you can view the source by looking in the package contents. Recently, ruddfawcett posted his AD search application he made with AppleScript and the source ...
4
votes
2answers
8k views

How can I configure my computer to run an AppleScript at a specific time? Caveat: without using iCal

Since upgrading to Lion, I have seen a sleight decrease of productivity when it comes to using iCal. As a result, I am trying alternatives such as BusyCal. The application seems great, however I cant ...
4
votes
3answers
6k views

How can I trim the first 3 characters in file name with AppleScript?

Is there a way to trim off the first 3 character of multiple file names? (or last 3 characters)
4
votes
3answers
587 views

How can I swap the primary display automatically in a dual-monitor setup?

I have a MacBook Pro and two Thunderbolt displays at work. I work with the MacBook lid-closed because it's overkill and I don't have enough desk space anyway. Every morning I show up to work and plug ...
4
votes
1answer
3k 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 ...
4
votes
2answers
698 views

Bash Script that will start up second Terminal process?

I need a script that will be able to fire up a second Terminal instance and pass a command directly to that one whilst it continues it's own executions. It's to start up Python script that will host ...
4
votes
1answer
97 views

Applescripting ODBC

Is it possible to interact with an ODBC connection within AppleScript? Or must one break out into another process (e.g. Python, Perl, etc)?
4
votes
5answers
1k 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 ...
4
votes
3answers
858 views

How to make a simple app from an applescript!

I've got an applescript that I use to open files such as test.txt in vim, using the terminal. I usually open a file by right-clicking it an selecting the service open in vim (this service is created ...
4
votes
2answers
1k views

OS X - AppleScript Question about moving files daily to another folder (folders vary)

I am currently using this ( http://lifehacker.com/193778/download-of-the-day--auto+applescript-tickler-file ) for a tickler file system and have it setup in my Dropbox (so it works across systems). ...
4
votes
1answer
198 views

How to register an AppleScript as a potential default web browser?

I've written an AppleScript that I want to set as the default browser. I've added a CFBundleDocumentTypes section to the p-list (copied from Safari) and rebuilt the launch services database, but that ...
4
votes
1answer
566 views

How can I automatically download multiple sites through Coda?

I have several sites in Coda that I would like to automatically re-download when I tell it to. The sites are collaboratively managed, and I'd like to download a fresh copy of the sites automatically. ...
4
votes
2answers
171 views

Applescript: Open current Safari tab in Chrome (Troubleshoot of working script)

So, I decided a while ago to run a Flash-free install of Safari. It's been really great, Safari seems much more stable overall and I barely miss it. But every once in a while I stumble upon a site ...
4
votes
1answer
333 views

Execute a custom script when OS X 10.8 is in Power nap?

Apple new feature of OS X 10.8 in new Macs "Power Nap" checks email and does make backups. Is it possible to execute a custom script (bash, AppleScript,...) when OS X 10.8 is in Power nap mode? For ...
4
votes
2answers
2k views

Using applescript, how to move a window to my second display?

I have experimented with absolutely every possible scripting option I can find on the web, and no matter what I do I cannot move a FaceTime window to my secondary display. This works... tell ...
4
votes
1answer
76 views

osascript to set secondary desktop background?

I have been using this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd> <plist ...
4
votes
3answers
527 views

Is there a sane way to emulate the newer media key behavior completely on an Apple Extended Keyboard II?

The operative word here being "completely". I recently found a nearly flawless (cosmetically and functionally) AEKII (Alps, not Mitsumis) on eBay and won it for $30. It's an awesome keyboard and it ...
4
votes
2answers
370 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 ...
4
votes
1answer
878 views

Can I write an Automator/AppleScript script to download all the iTunes app updates?

This is related to How can I tell iTunes to always download free updates I would like to write a script to tell iTunes to download all the free app updates available, and have that script run ...
4
votes
1answer
71 views

Automatic Window Switcher

I'm looking for a Mac app that will accomplish the following: Switch between two full-screen mac apps - Tweetdeck and iCal, automatically on a timed interval. Back and forth without stopping. We ...
4
votes
0answers
219 views

Printer Deploy with and custom preset profiles to Mac OS X workstations

How would I go about deploying a network printer (Sharp MX-2600N) to Mac OS X machines that would include a custom printer preset profile (Embedded Printer User Authentication Code)? Ideal Method of ...
4
votes
2answers
423 views

How can I change a file's creator code on vanilla Snow Leooard?

When Xcode is installed your best bet to change a file's creator is SetFile. I only found AppleScript. Unfortunately, while the type is set correctly, the second line silently fails on my 10.6: set ...
4
votes
1answer
255 views

Any way to write the Terminal scrollback history?

I would like to open a new tab in Terminal with custom scrollback history. The primary use-case is to "fork" an existing tab such that both tabs contain the same scrollback history, but more generally ...
3
votes
4answers
4k views

Can I download all pictures on a page?

Is there a way I can run a script with a certain web page as the argument that will download all the images from there?
3
votes
5answers
551 views

Good/inspiring uses of automation on Mac OS X

I have been a mac user for quite a while now (about 5-6 years) and I would consider myself rather tech-savvy. That being said I have very little insight to the automation capabilities that have been ...
3
votes
2answers
10k views

Converting HTML to PDF using convert utility in Mac OS X

I'm trying to convert a bunch of HTML files into PDF files. I'm looking for an automated solution so that i don't have to open each HTML file individually and convert it to PDF. In Mac OSX, convert ...
3
votes
4answers
2k views

Can Python/Ruby/Perl/etc (or even bash) replace AppleScript?

I'm not inviting people to hate on AppleScript in general; I'm just wondering if what makes AppleScript useful can instead be used by other general-purpose scripting languages. I.e., Lion & Mac ...
3
votes
2answers
298 views

Is there a definitive reference or introspection capability for Applescript?

Is there some canonical place I can find a reference for the scripting capabilities various things have in AppleScript? For instance, I'd like to automate iTunes a little bit. Looking around on the ...
3
votes
6answers
9k 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 ...
3
votes
6answers
387 views

How to make an existing AppleScript file to work as a service?

I made an AppleScript, saved it as a file in a specific folder on my hard drive. Now I want to assign a shortcut to it and looks like I have to make a Service via Automator, but the Run AppleScript ...
3
votes
3answers
2k views

Programmatically/Script-atically changing the default Open-With setting

Is there a way to change what app opens a file type programmatically/with a script? Basically, sometimes I'm working on a web site, and I want to set all web files to open with a text editor (*.php, ...
3
votes
1answer
5k views

How do I click a button using AppleScript?

I'm trying to press a button in TeamSpeak using applescript, here is my code: tell application "TeamSpeak 3 Client" to activate tell application "System Events" tell process "TeamSpeak 3" ...
3
votes
2answers
38 views

How to close applications on sleep?

I have a password management application (KeePassX) of which backup I sync over Dropbox across several computers. However the password database can be open only on one computer at a time for file ...
3
votes
2answers
272 views

Emulating associative arrays in AppleScript

A problem that would be trivial to solve with key=>value pairs. For each item in list_a, find the matching item in list_b and compare a single attribute (calculate scale ratio for two sets of images). ...
3
votes
1answer
800 views

Save attachments from Mail.app based on subject

I have been trying to write an Applescript to help me saving attachments, but realized quickly that I do not have the knowledge to do such a difficult script. Here is some background. We receive ...
3
votes
2answers
318 views

Copy message_id from selected message

In Mail, when I've selected a message, I would like to have a shortcut to copy the message_id (see my previous question) to the clipboard. How do I manage that? Applescript, I presume?
3
votes
2answers
2k views

Any way to trigger Folder Action when adding file to any subfolder?

I've created a Folder Action in Automator and applied it to a folder. But it only gets triggered when a file is added to the root of that folder, not to one of its subfolders. Is there any way to get ...
3
votes
1answer
303 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 ...
3
votes
4answers
83 views

AppleScript: Press Enter Every X minutes If Terminal is Open and Application Has Been Idle for X Minutes

I am new to AppleScript and am attempting to use it. If I am using Terminal and if I have not pressed a key for x minutes I want my Mac to press the return key. It is to repeat this process every y ...
3
votes
2answers
2k views

How can I stream audio to multiple computers at the same time?

I'm trying to stream music to different computer's speakers simultaneously. Currently I'm doing this by physically timing the start of the song on each computer. Are there any built in utilities or ...
3
votes
1answer
186 views

“@” symbol in password in applescript

I am using an applescript to mount a users home folder. However, when I use a password with a "@" symbol the script fails since the "@" symbol is also the separator between the password and ...