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

Command-line voice recognition with Mac OS X

How can I do voice recognition on Mac OS X from the command line? Details: % When I look in ~/Library/Speech/Speakable Items, I see many files, like "Tell me a joke", whose contents are: ...
5
votes
3answers
135 views

AppleScript to show package contents of hidden original of alias

I'm writing an AppleScript that will be run from within Automator, because ultimately I will define a keyboard shortcut to call it as a Service. I don't know any way to have a Service appear in an ...
5
votes
3answers
247 views

Set a keyboard shortcut to clear all tracks from the Up Next queue in iTunes

I am looking for a way to assign a keyboard shortcut to clear all the tracks from Up Next queue of iTunes. Does anyone know a way to do this? Using Mac OS X Mountain Lion 10.8.4
5
votes
1answer
446 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 ...
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
405 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
801 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
1answer
160 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
1k views

look up a word in Dictionary.app in Terminal

Is there a bash or applescript to look up a word in /Applications/Dictionary.app from a Terminal window ? open -a /Applications/Dictionary.app/ --args word ignores --args, says "type a word to look ...
4
votes
3answers
513 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
5answers
5k 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?
4
votes
2answers
552 views

Automating ffmpeg using Automator Service

I often use ffmpeg off the command line to convert video files into mp4 on my Mac (running Mavericks). Do note, however, that I am NOT re-encoding my videos; am just changing the container from an avi ...
4
votes
2answers
6k 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
532 views

Where can I access official AppleScript documentation?

Is there any official AppleScript documentation? If so, where can I find it?
4
votes
1answer
89 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
10k 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
8k 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
6answers
1k 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 ...
4
votes
3answers
2k 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
822 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
3answers
1k views

Find a specific file with automator

The basic question is: How can I pass a filename to the Spotlight search module in Automator? The essential problem: I have hundreds of broken aliases scattered throughout a particular ...
4
votes
1answer
111 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
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 ...
4
votes
3answers
1k 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
3answers
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 ...
4
votes
1answer
216 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
623 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
1answer
68 views

How can I restart from an Apple script without warnings?

I wrote this Apple Script to bless my Windows partition and boot to Windows only once: do shell script "/usr/sbin/bless --device /dev/disk0s3 --setBoot --legacy --nextonly " with administrator ...
4
votes
2answers
93 views

Applescript File vs Alias

I have these two Applescript commands in which they both point to the same file alias "Macintosh HD:Users:scott:Dropbox:Downloads:AppleScriptFinderGuide.pdf" file "Macintosh ...
4
votes
2answers
676 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
1k views

Toggling screensaver password with script

I am using a rather old application called Proximity to trigger applescripts when my phone goes in and out of bluetooth range of my mac. Along with other tasks, I want to secure my laptop when the ...
4
votes
1answer
2k 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 ...
4
votes
2answers
1k views

Automator app with a menubar icon

I've created an application with Automator. I want to have a new icon in the menubar like this: Which starts the app when I click on it. Is it possible? (without using Xcode) PS: I don't ...
4
votes
1answer
177 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
709 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
429 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
970 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
2answers
42 views

How to disable shortcut for an Automator script?

A few weeks ago I wrote a short script with the Automator to get familiar with it. I found a website which explained how to set up a primitive script to start the screensaver and define a shortcut to ...
4
votes
1answer
74 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
1answer
310 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
477 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
277 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
5answers
681 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
11k 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
3answers
5k views

Applescript to retrieve account and password using keychain scripting

How can I use keychain scripting to write a script in Applescript that retrieves the login and password of a website from the login keychain, given the website's URL?
3
votes
2answers
2k views

Allow application to control computer (assistive devices) on Mavericks via Terminal?

I'm currently working on automated instalation of Mavericks 10.9. I have NetBoot set up. Everything works OK untill I want to execute Applescript. Since the release of new version I need to manually ...