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

learn more… | top users | synonyms (2)

1
vote
2answers
635 views

How do I set podcast release date in iTunes using Applescript?

I would like to add the release date to podcasts that I've imported into iTunes, but my applescript is returning an error about the date object. tell application "iTunes" set theSelection to ...
3
votes
2answers
1k views

Terminal: Path to Network Drive in Applescript

I am trying copy a file up to a network drive in AppleScript. Normally I would do.. do script "mv ~/Desktop/file.txt ~/Folder/file.txt" What is the correct path to a network drive? I normally ...
6
votes
4answers
8k views

How to know the name of UI elements using Accessibility inspector (or any other tool)

I'm trying to interact with a print dialog via Applescript. What I want to emulate is the user setting a value on a specific dropdown. Say I have: tell application "System Events" tell process ...
2
votes
2answers
4k views

When MouseKeys are on, how do I click or move the mouse using AppleScript?

This post suggests that the command tell application “System Events” to key code 37 in AppleScript should move the mouse pointer one pixel down and to the left if run when MouseKeys are enabled. In OS ...
3
votes
2answers
330 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
2answers
1k views

Is there a way to turn on and off the Mouse Keys feature using AppleScript or a terminal command?

I'm running Mac OS X 10.7.2. Is there a way to run an AppleScript or terminal command that quickly turns on or off the "mouse keys" feature under the Universal Access tab? Ideally I'm looking for a ...
2
votes
2answers
1k views

Is it possible to switch to a specific keyboard layout via `defaults`, *.plist or similar?

I have figured out a workable shell script using osascript (AppleScript) to automatically switch to US keyboard layout when MacVim activates (triggered by Keyboard Maestro), and Swedish layout when it ...
1
vote
1answer
105 views

Make a file a Stationery pad via command line

Is there a way to set make a file into a Stationery pad from the command line? You can do it by clicking "Get info" on a file and checking the box, but I would like to do it without clicking. An ...
0
votes
1answer
267 views

Generate an iOS Project (.xcodeproj) with AppleScript

How can I generate an iOS project (.xcodeproj) with AppleScript (without XCode)?
6
votes
3answers
3k views

Script to raise a single window to the front

In a script I'm trying to find the Terminal.app window containing a specific tty device and raise that window to the top. Here's what I have in Applescript so far: tell application "System Events" ...
10
votes
5answers
2k 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)?
0
votes
1answer
120 views

How can I make a keyboard configuration become default when I hook it up?

At work, I have a MacBook Pro and a RHEL workstation that share a HP keyboard and mouse via a KVM switch. I do most of my work on the Mac so I prefer to change the modifier keys so they command and ...
1
vote
1answer
235 views

Automator Service that does predefined simple calculations

I'm working as a salesman and what I need to do a lot of times a day is calculating the price +VAT and -VAT which is 19% here in Germany. I found some calculation automator script but wasn't able to ...
0
votes
2answers
1k views

How to run a downloaded run-only Applescript

I am trying to run an Applescript, but when I double-click it, it tries to open Applescript editor and informs me that it was saved as "run only". This is fine -- I just want to run it! The script in ...
3
votes
1answer
631 views

How can I generate dynamic keynote presentations?

I'd like to build a series of Keynote presentations that contain some dynamic elements. By that I mean some elements are "compiled" in later. For example if I have a code sample on a slide, I want to ...
3
votes
3answers
1k views

Show text using Large Type without relying on third-party applications

Apple has this amazing feature called 'Large Type', chiefly implemented into Address Book. When you look up a contact, you can right-click the phone number and click 'Large Type', and it will display ...
0
votes
1answer
123 views

How do I refresh Application metadata - URL handlers, Web browsers - after installing my own AppleScript?

I'm working on an Apple Script that handles URLs. There's a command one can give which re-creates the list that Safari shows to change the default web browser. Anyone know what this is?
1
vote
1answer
302 views

Running AppleScript When Inserting a Blank CD

I want to automatically burn a cross-platform data CD with the same contents each time a blank disc is inserted, and eject it when done. To that end I created a very simple AppleScript that does just ...
1
vote
2answers
733 views

Automatically delete temporary ~/Library/Application Support folders

I have a flash drive which I carry around everywhere which has a few standalone applications which I use everywhere installed on it. However, the majority of these leave Application Support folders ...
1
vote
2answers
5k views

How can I remove a portion of from the middle of a movie?

Quicktime Player help: With QuickTime Player you can quickly remove a portion of the beginning or end of a movie or a movie clip to make it shorter or remove unwanted content. I want to ...
1
vote
2answers
613 views

FTP Client with AppleScript support

I'm looking for an FTP client with the following requirements. File/Folder sync Sftp/SSH tunnelling Outstanding AppleScript support Runs on Lion The GUI interface is not overly important as it ...
18
votes
1answer
30k views

How do I automate a key press in AppleScript?

Is it possible to automate the key press of a key (such as "a" or "<") in Mozilla Firefox, Google Chrome or Safari (in this order)? I'd like to automate the key press of "a" for example in Mozilla ...
2
votes
3answers
4k views

/bin/sh: rm: command not found

I have problems with some applications that use AppleScript shell script feature. For example, Growl's uninstall scripts shows an error: error "/bin/sh: rm: command not found" number 127 The source ...
0
votes
2answers
461 views

Applescript - ignore modifier keys

I have an applescript that needs to be called by an external program with command-shift-click. However, the applescript then performs keystrokes with command & shift held down. How do I get ...
2
votes
2answers
1k views

AppleScript “Kill” Command Error

I am attempting to run an AppleScript every 24 hours to close a running application and restart it. I have used the following code successfully with other Apps: repeat delay 84600 set app_name ...
2
votes
3answers
418 views

How can I run a PHP script by dropping file on icon?

I have a php script that takes a filename as an argument. When I run it from a terminal window I type ./my_script.php file_to_process.txt It works great! What I would like to be able to do is to ...
3
votes
1answer
1k views

List of (activated) fonts with shell command in os x

Is here any shell command for getting the list of activated fonts? Mean something like: some_font_util -activated -format 'file: name' for getting a list of activated fonts in a form: ...
1
vote
1answer
565 views

How to script “add to iTunes Library”

I'm trying to deliver as a download a collection of audio files such that the user (preferably Win and Mac) would be able to double click on the file (perhaps a DMG? / ZIP) and launch a script that ...
3
votes
3answers
361 views

How can I have a fixed order of the menu-extras?

Like the OSX menu items for wifi, battery... I would like to be able to have a permanent order of the third-party menu bar items. I do not want to mix OSX with third-party menubar items, I simply ...
2
votes
3answers
525 views

Create a command to focus a specific window from anywhere in OS

While developing for the web I tend to jump back and forth between my text editor and the browser a lot. I'd like to set a keyboard shortcut at the OS level that allows me to jump to a specific, ...
1
vote
0answers
105 views

Sending a “show next” command to multiple computers

I am trying to sync the advancement of Keynote slides on two matching computers. I am running into a delay on the second machine. ( I have switched the tell blocks and the second machine is always ...
2
votes
2answers
682 views

AppleScript to add files to an iOS app under iTunes

I know it's possible to write an AppleScript to add music and video files to the iTunes library. Is it also possible to write AppleScript to add files to iOS apps that use file sharing? For example, ...
1
vote
0answers
276 views

Populate Pages Chart Data via Applescript

Right now I'm copy and pasting between Excel and specified places in a Pages document. For instance, I'll copy cell B7 and find "B7_Value" in Pages and replace it with the copied value. Here's an ...
0
votes
1answer
390 views

Auto vpn connection dependent on Wifiname

I recently asked a question Auto connect vpn upon login/boot which got answered well using apple script . I want to extend this question to the following problem: The vpn connection should be ...
1
vote
2answers
176 views

How can I browse the directories of an external drive even when it is not attached?

I am new to this. Is there any script that analyzes and creates an XML files the entire file structure of any external hard drive that is connected to the computer,including all the fill names in all ...
1
vote
2answers
2k 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 ...
4
votes
1answer
209 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 ...
0
votes
3answers
861 views

creating script for ical events from properties of address book entries

I want to create a script that creates alarmed events in ical for birthdays of people that I have in my address book. Unfortunately, I am very bad working with applescript. Below is the outline of ...
1
vote
1answer
196 views

Looking for workflow or script for saving Kindle documents

I'm using a Kindle DX (3G, no WiFi) for reading documents saved from the web with Readability. Because Amazon charges a conversion cost for these documents I'm forwarding the documents to my ...
1
vote
1answer
200 views

How can I regularly move movies in iTunes to an external drive?

I have been adding a lot of movies to iTunes lately. Problem is, the size grows very quickly. I appreciate having the metadata in one place, but I would want to move the actual files to an external ...
3
votes
3answers
3k 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 ...
2
votes
1answer
432 views

Can you (semi-)automatically rate all songs with at least X plays with Y stars in iTunes?

After reconsolidating my music collection in iTunes, I’m curious if there is any way to programmatically set star ratings based upon the number of plays, but only for songs that I have not yet rated? ...
0
votes
3answers
725 views

Applescript to disable screen saver through sending keystroke

I'm trying to write an applescript that will disable the screen saver through sending a keystroke. Something like sending a "shift key" pressed every 30 seconds. I don't want to have the applescript ...
2
votes
0answers
645 views

With Lion, Problems Accessing Shared NTFS Folders with SMB://

We are testing a local login script that we created for our Macintosh users on Lion. It has worked fine on all OS X versions prior to 10.7. Listed below is the script that we are using. When we run ...
1
vote
1answer
401 views

Is it possible to run a shell script when the iChat online status changes on Lion?

I had a script under Snow Leopard that would upload a tiny file to my server when I launched iChat to reflect my status on my website. For some reason it doesn't work anymore in Lion. Is there a way ...
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 ...
8
votes
3answers
1k views

How can I make an AppleScript activate upon logging in?

Is it possible to force an AppleScript to activate when I log in?
2
votes
1answer
926 views

How Can I Restart in Windows Using a Script?

I'd like to be able to reboot into the Boot Camp partition without needing to go change the Startup Disk in System Preferences or holding down the Option key at startup. After reading some stuff on ...
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 ...
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: ...