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

learn more… | top users | synonyms (3)

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
172 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
133 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
326 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
439 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 ...
4
votes
1answer
1k 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 ...
0
votes
2answers
623 views

How to make Applescript quit a specific program for all users?

My wife and I are set up on a single laptop and I have our iTunes libraries stored on an external HD. I'm writing an applescript to auto eject that drive when we want to take the laptop elsewhere (we ...
4
votes
1answer
9k 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" ...
10
votes
4answers
4k views

AppleScript vs. Bash script?

I'm a long-time Windows "power user" and developer who has recently decided to move over to Mac OS X. On OS X Lion and indeed previous versions there seem to be two main options for scripting and ...
0
votes
1answer
421 views

pasting commands from TextWrangler to Terminal (applescript troubleshooting)

I have a following script that I have been using for years to paste selection or a whole line from TextWrangler to R. I got it from some website, slightly modified, and it has worked perfectly: tell ...
1
vote
1answer
149 views

How to find out which file triggered an action from spotlight

I've created an applescript application (in automator) to open ssh urls. The application is bound to the ssh:// url. I've got a lot of user@host.inetloc files and search these in spotlight. Selecting ...
2
votes
1answer
710 views

Print folder contents with non-standard printing settings

I want to print all files which are dragged to a folder. Easy to do with Automator. But I want to specify more settings for the print, namely to print the items two times, to use paper tray 2 instead ...
3
votes
1answer
522 views

How do I reliably get the file name of the current background picture?

Latest Lion update broke a simple Geeklet osascript that used System Events to lookup of Background picture names. Running the associated command from the terminal returns the same name, every time, ...
2
votes
2answers
3k views

Using Automator or AppleScript to encrypt/decrypt with OpenSSL

I would like to know how to use Automator or AppleScript to create a droplet that would compress/uncompress (tar.gz) and encrypt/decrypt with OpenSSL files and/or directories dropped in it. The ...
4
votes
1answer
2k views

Automatically Mount a Network Drive and Copy a File to a Network Folder (AppleScript)

I've a rather complex task to solve. I don't use OS X, but now I have to provide some colleagues with a simple application that automatically copies a certain file to a network folder. Normally I'd ...
2
votes
1answer
525 views

What are some good resources for learning how to AppleScript with Xcode 4.3.2?

I AppleScript quite a bit and I'd like to start working with Xcode 4.3.2, so that I can expand the functionality of the things I'm writing. However, I have no idea how to use Xcode, nor how to ...
2
votes
1answer
2k views

Is is possible to format an Applescript dialog?

I am writing an AppleScript and I'd like to be able to format text in a display dialog box. For instance, I want part of the text to be bold or italic. How can I do this?
4
votes
1answer
91 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 ...
1
vote
1answer
117 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 ...
2
votes
1answer
1k views

AppleScript to display the VPN status bar area icon

I am trying to write an AppleScript to connect to a VPN service. Once connected to the VPN, I want to display the VPN icon in the status area of the menu bar. I've gotten as far as connecting to ...
7
votes
1answer
450 views

Simple auto-typer with AppleScript

I want to make a small application that will type the number 1, wait an interval, type the number 2, wait an interval, type number 3, wait an interval, etc. This works for typing one number over and ...
3
votes
1answer
858 views

How do I return the number of the current window in Chrome and open a new tab in it?

I am writing an AppleScript in which I need to get the number of the current window of Google Chrome and open a new tab in it. I want something like this (pseudo code): set curWindNum to the current ...
1
vote
1answer
1k views

Ejecting USB drive via AppleScript does not make drive power down

On startup, I eject my external USB disks with the following AppleScript: try do shell script "diskutil eject \"/Volumes/USB Backup\"" end try This works as expected: the drive powers down. ...
2
votes
1answer
4k views

Why is my applescript for checking if a file exists failing?

I have an applescript application that inputs a username and starts a download based on that username. In the app I use the code below to check if a file exists already and then rename the file if it ...
4
votes
1answer
121 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
2answers
578 views

Where can I access official AppleScript documentation?

Is there any official AppleScript documentation? If so, where can I find it?
5
votes
1answer
492 views

How can I use an Applescript from within a program?

This question Is there a way to add all of the recipients of an email to a group/folder in contacts from Mail? seems to have an answer that would be useful for me, but I don't actually know how to use ...
3
votes
1answer
2k views

Run AppleScript after waking from Sleep?

Is there an easy way to run an AppleScript or application immediately (or a brief delay of X seconds) after waking up from sleep? I'm looking for a solution that doesn't involve a 3rd-party app.
0
votes
1answer
3k views

Use AppleScript to launch and manage Quicktime Player in the background

I have a Perl-based audio player that runs on OS X, and I need to update how the audio files are played. I'd like to use AppleScript to control the QuickTime Player, because it will do what I need, ...
1
vote
1answer
604 views

Modifying “User interface sound effects” with applescript

Good morning all, I would like to be able to turn the system sounds on my mac off (and back on) with an applescript activated as an extension for Alfred. I have little knowledge of applescripts but I ...
1
vote
1answer
1k views

Using applescript to control an application which does not support it

I want to control an application that does not have an Applescript api (simfy). I would like to pause it via an Alfred command, but for this I need to use scripts. This application is build with Adobe ...
2
votes
4answers
1k views

cron is failing to run my AppleScript

I have the following code in a text file (myfile.applescript): #! /usr/bin/osascript tell application "Google Chrome" to quit I would like Chrome to shut down each night at 9:15PM, so I added the ...
3
votes
1answer
543 views

How to Unset iTunes Track Start And Stop Time For Multiple Tracks?

For some reason a lot of tracks in my iTunes library have senseless start and stop times set. This is really annoying as some tracks get skipped after a few seconds. There are Apple Script commands ...
3
votes
2answers
556 views

How can I successively trigger an AppleScript very quickly?

Background For fine volume adjustment I use the following AppleScript: try do shell script "killall afplay" end try set currentVolume to output volume of (get volume settings) set volume output ...
0
votes
0answers
24 views

Launch program after inactivity [duplicate]

Possible Duplicate: How can I automatically launch an application whenever the Mac goes idle? I'd like to launch an AppleScript/ App after 30 minutes of system inactivity. e.g. no cursor ...
1
vote
1answer
584 views

AppleScript broken in Lion?

It seems like I cannot execute AppleScripts on my Mac. I am running OS X 10.7.1 and when I try to compile an AppleScript, even a script as simple as display dialog "Hello World!", I get a syntax ...
5
votes
2answers
963 views

A programmatic method for disabling all sharing services?

I'm seeking a programmatic method for disabling all the sharing services on a Mac. My preference is for an AppleScript or a shell script. I'd like to have the services shown in the picture below ...
3
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 ...
1
vote
2answers
783 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 ...
2
votes
1answer
410 views

Always show service in contextual menu

Sometimes when I create a service in Automator, I want it to always appear in the Finder contextual menu, not just when I have a selected a file or folder. The services are always either pure ...
1
vote
2answers
181 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 ...
3
votes
2answers
2k 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 ...
2
votes
2answers
2k 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 ...
4
votes
2answers
409 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 ...
0
votes
1answer
312 views

Generate an iOS Project (.xcodeproj) with AppleScript

How can I generate an iOS project (.xcodeproj) with AppleScript (without XCode)?
0
votes
1answer
139 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
270 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
2k 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 ...
1
vote
1answer
3k views

How do I download a URL using Applescript

I used to be able to download URLs from an Applescript, but I lost the Applescript. I want to enter a URL: i.e.: "http://wpclassic.com/go.php?http://www.revolutiontwo.com/download/tv.zip" and have it ...
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 ...