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
2k views

Create playlists for full albums in iTunes (i.e. albums with all songs)

How could I create playlists for all of the albums in iTunes for which I have all of the songs? Assume that track number & track count metadata is accurate where specified, and don't worry about ...
1
vote
2answers
437 views

Applescript creating Sym link with spaces in the path

I'm trying to create a sym link to a network directory when i log in. This is working for a couple of other directories without spaces in the name, but for the life of me I cannot get this one ...
0
votes
3answers
781 views

Setting a variable to the result of a terminal command within an applescript

I'm trying to make a script that ejects all connected external drives and does not move on until they are all disconnected. The main problem I'm having is being able to set the variable vol_count to ...
2
votes
1answer
563 views

Automator finish one task before moving on?

I have automator running several applescript commands that I want to happen sequentially. For example, I have an empty trash command, then a shut down command. When I run the script, the computer ...
0
votes
1answer
726 views

Any way to delete custom fields of cards in Contacts.app?

Some custom fields of contact cards in Contacts.app are really annoying. For example, nicknames always appear in Mail.app. To make things worse, there seems to be no menu option to delete custom ...
2
votes
1answer
316 views

Is there a GUI viewer of databases created by Database Events?

I wrote a simple AppleScript that saves data to a Database Events database. I see the database (DBEV file) in my ~/Documents/Databases folder, and I am wondering if there is a simple graphical utility ...
2
votes
1answer
456 views

Can OS X automate creating a reminders from a page in a web browser?

I enjoy the feature of creating reminders from a web page with one click. similar to how Omnifocus does this. Can Apple's Reminders do the same by apple scripting or other addition/short cut?
2
votes
1answer
744 views

Activating Mountain Lion screen saver from Applescript, part 2

This example was shown earlier: tell application "System Events" set ss to screen saver "Random" start ss end tell Is there an incantation instead of "Random" to display a slideshow from ...
1
vote
2answers
151 views

automator: get a folder if it dropped or ask for one otherwise

I'm building an automator application that acts on a folder that needs to be specified. Until now, I've been using the "Ask for Finder items" action to ask for a the folder to be used, but I would ...
0
votes
2answers
389 views

Applescript to update year tag for audio files

I have a lot of tracks in iTunes where the files are named "music-NNNN.mp3" with NNNN being the year the track was recorded. How can I use Applescript to automatically set the year tag for these files ...
1
vote
2answers
1k views

How can I automatically run an AppleScript on shutdown or logout?

I am more used to the Javascript style event handlers, but is there a similar thing in applescript that listens to system events like logout or shutdown to execute code or is there a way to have an ...
0
votes
1answer
845 views

Position windows via command line

I've got a little bit of ruby that sizes and repositions windows to a saved layout. It uses a snippet of AppleScript to actually do the positioning: osascript -e 'tell application "Twitter" to set ...
3
votes
1answer
137 views

Can I run an AppleScript upon my 3G modem connecting?

I'm looking for a way to run an AppleScript after my 3G modem is successfully connected to the carrier. The modem is using the standard OSX network panel to connect, so it's not using any crappy ...
2
votes
2answers
330 views

Applescript to quit all active browser processes

I am trying to quit all the active browsers using the below code, but am unable to get the list of all active browsers to quit. tell application "System Events" set appList to every process ...
3
votes
1answer
626 views

Get notified when battery is charged

Is there a way to write a custom apple script or any other way to get a Alert or Desktop notification when the battery on my Macbook Pro reaches a certain percentage of charge?
3
votes
1answer
365 views

Problem with my applescript to export keynote files to powerpoint

I've a big problem with an export applescript. I would like to export many keynote files to powerpoint files. I found this script below, but there is an error that tells that the menu item ...
0
votes
2answers
882 views

Automator & AppleScript: How do I import the texts of Notes and Reminders as PDFs and RTFs?

I would like to export and save the Notes and Reminders documents or texts as PDFs and RTFs, keeping or preserving the formatting and the background of Notes or Reminders, but the Notes doesn't have ...
1
vote
1answer
450 views

How do I command Automator to convert the multiple images from PNG to ICNS once at all? (Solved)

I use OS X Mountain 10.8.2. I used Automator and added AppleScript, copying the command from the old app's developer at the Iconoodle - Convenient ICNS to PNG image conversion (Iconoodle isn't ...
1
vote
1answer
106 views

How to start a service automatically after openning an application?

For example, I have a service that I want it to be started automatically when I open Firefox. I know how to write scripts as services in automator, but I don't know how to make a hook that when ...
1
vote
2answers
422 views

Automatically move files into correct folder on server

I often need to move files from one location on a server into a set of hierarchical folders. The filenames are usually 7 digits long - sometimes with some extra characters at the end. The folders ...
0
votes
1answer
374 views

Programmatically read both per-tab Terminal.app titles

When bringing up the Inspector (⌘I) in Terminal.app to edit the title (⇧⌘I), there are actually two titles that can be entered. The first is known as the Tab Title and affects the terminal window ...
0
votes
1answer
181 views

Script to Update/download most recent iTunes podcast WITHOUT opening iTunes at all?

I have a couple favorite podcasts that I subscribe to in iTunes. I'm using You Control (so I don't have to open iTunes to play my music). I'm using Keyboard Maestro. I've made a macro that runs ...
4
votes
1answer
286 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 ...
1
vote
2answers
4k views

How can I get certain types of files dropped in certain folders based on file type?

I was wondering if it is possible to have the following: In my Downloads folder, I have 2 subfolders : IMAGES and VIDEOS. Is it possible to automatically move every image downloaded to the Downloads ...
0
votes
2answers
3k views

Applescript to add sender of message to specific group in Contacts

I'm trying to set up an Applescript to add the sender of a selected message in Apple Mail to a specific group in the Contacts app. By reconfiguring the code provided in this answer, I worked up the ...
0
votes
1answer
5k views

Automatically Save Attachments in Mail.app in 10.8 Mountain Lion

I am trying to automatically save all email sent to one address (let's call it test@example.com) to this folder /Users/luomat/Dropbox/Incoming/e2w/ (where /Users/luomat = $HOME). Here is the rule ...
0
votes
1answer
84 views

Turn on iTunes EQ via AppleScript

Can I turn the iTunes EQ on/off using AppleScript? I found a way to change the preset, but not turn the EQ on or off.
2
votes
1answer
226 views

Safari - menu to show live tabs open in open windows

I often have five or six Safari (and Chrome) windows open, each containing several tabs. I often lose track of where a live tab is when I want to return to it. I can use the Safari window menu option ...
1
vote
2answers
2k 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 ...
0
votes
1answer
2k views

How to initiate a specific keystroke using automator?

I have the following code : on run {input, parameters} if application "KeyboardViewer" is running then quit application "KeyboardViewer" else activate application ...
-1
votes
1answer
437 views

Applescript opens new window for everything when run

I have the following code I did for a tweetbot keyboard shortcut to open tweetbot and create a new tweet. on run {input, parameters} activate application "Tweetbot 2" tell application ...
1
vote
1answer
438 views

How to start an app in the foreground?

For some reason, gitk always starts under all other apps. How to make it start on top of all other apps, like a normal program? Start it from the terminal with the gitk command, which lives in ...
1
vote
1answer
217 views

F.lux does not always work on resolution changes. Is there a way to check if the resolution changes?

I'm a happy user of f.lux, but sometimes when I plug in my external monitor on my macbook air it returns to full brightness. This also sometimes happens if I unplug my external monitor and switch to ...
2
votes
1answer
379 views

How to replace images in iPhoto with higher quality versions?

I use Aperture for photo editing and processing, but prefer iPhoto for keeping a gallery of my pictures. For a long time, I used the built-in tools in iPhoto to "Import from Aperture Library". What I ...
3
votes
0answers
285 views

Applescript vs. Spaces in Lion (10.7)

In Snow Leopard (10.6), I had an applescript that toggled iTunes between "maximised on Space 2" and "mini-player on all spaces": set app_identifier to do shell script "echo 'com.apple.iTunes' | ...
2
votes
1answer
326 views

Can I run a program whenever I open the lid of my MacBook Air? [duplicate]

Possible Duplicate: Run AppleScript after waking from Sleep? I have a program, InstantShot!, set to launch at logon and start taking a screen shot every 10 seconds. Unfortunately, when I ...
4
votes
3answers
576 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 ...
0
votes
4answers
593 views

Pressing the control key with AppleScript

I use Voice Over and Dragon Dictate. I have figured out how to make Dragon Dictate press Control-Option-A, which makes Voice Over read a page of text, and now I would like to figure out how to tell ...
1
vote
2answers
1k views

How to check which files are not in iTunes library, but are in iTunes folder?

This is a question from Wil Wheaton's google+, but I would like to get an answer too, stackexchange style. Suppose you have all your music in a folder called /iTunes/Music. When you add files to ...
0
votes
2answers
247 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
589 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 ...
3
votes
1answer
293 views

AppleScript/Automator Workflow to restore OS X to “mint” condition

Under Mountain Lion, I wanted to create an AppleScript that would essentially restore my OS X install to "mint" condition, if possible even to the point of showing you the ML welcome screen asking you ...
2
votes
2answers
535 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 ...
5
votes
2answers
3k 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 ...
8
votes
3answers
1k views

Copying files to the clipboard using applescript

Often I find myself at the command line wanting to copy files to the clipboard, so that I can paste them as attachments in Mail. If I have an image file, image1.png, I can accomplish this with ...
1
vote
2answers
386 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 ...
0
votes
1answer
289 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 ...
3
votes
2answers
1k views

Why does this applescript not actually set the input volume to zero?

I have this command that builds a script to mute the input volume. The input volume is not fully muted, though. It seems to be closer to 10% than 0%. osacompile -x -e 'tell application "System ...
3
votes
1answer
439 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 ...
1
vote
1answer
592 views

Script to delete all groups in contacts

I would like to have a script to delete all my groups in my Contacts. Somehow I got a kind of replication bug resulting in over 500 groups. Delete them one by one is not an option. Tried this script, ...