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

learn more… | top users | synonyms (3)

2
votes
1answer
1k views

Why won't my AppleScript run as a Service?

I have a simple AppleScript that works exactly as expected when run on its own, ether as an app, directly from within ScriptDebugger or Script Editor, or as an element of an Automation from within ...
1
vote
1answer
821 views

How do I change some text in an OmniGraffle document via AppleScript without changing the text's styling?

If I create an OmniGraffle document, add a text box with “Test” in red in size 28, I can change the text with this snippet of AppleScript: tell application "OmniGraffle Professional 4" set text ...
0
votes
1answer
118 views

Applescript won't play movie when waking from sleep

I have the following AppleScript, which is triggered by iCal to act as my alarm clock: set musicPath to the path to me as text set musicPath to text items 1 thru -12 of musicPath as text set ...
8
votes
2answers
6k views

How can I bring a window to frontmost without focusing it using Applescript in OS X 10.8

I want to bring a window (QuickTime for example) to frontmost, without focusing it. I can do it in OS X 10.7 using the following code in Applescript. tell application "System Events" set visible ...
0
votes
1answer
1k views

Trying to use applescript to launch cmd line 3 scripts in new tabs

I'm trying to launch 3 tabs and run a script in each with applescript. So far I havent been able to get this done. Currently I have: tell application "Terminal" activate do script "ping ...
1
vote
2answers
2k views

How do i pass variables' values between subsequent applescript runs? (persistent value between script executions)

I have an applescript that I run like a cron job. Within this applescript, i have variables that act like boolean switches (i.e. on/off values). With subsequent runs, depending on whether the boolean ...
7
votes
3answers
7k views

Activating screen saver from AppleScript in Mountain Lion

I had a script that I used to use to activate my screen saver, and it no longer works in Mountain Lion. It was a shell script that called an AppleScript script: #!/bin/bash osascript ...
3
votes
1answer
648 views

Does applescript's 'delay' function work when the computer is asleep?

I'm trying to make an alarm clock for myself with AppleScript after my old (physical) one crapped out. I've got a script that'll schedule a pmset wakeup at the requisite time. There's just the matter ...
124
votes
6answers
60k views

How can I trigger a Notification Center notification from an AppleScript or shell script?

I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write. Is there a built-in command or a third-party library I can use from either an ...
1
vote
1answer
452 views

AppleScript to tell Adobe Reader to close a certain document

Adobe Reader has N documents open. One of them has a known filepath and title and it needs to be programmatically closed. How to go about doing this in AppleScript? Specifically, how can I: Talk to ...
0
votes
1answer
185 views

Applescript to monitor terminal changes

I want to be able to check if a word appears in a terminal window running a java application and then display a notification. Any ideas?
3
votes
1answer
460 views

Finder list view, change column with to optimal with using AppleScript

I'm trying to create an AppleScript script that resizes the columns of Finder's list view (e.g. Name, Size …) to their optimal width (i.e. the minimum width where all text in the column is visible) on ...
4
votes
4answers
648 views

How can I see how long my computer has been active (as in not idle)

I've seen a variety of solutions to check how long my machine has been idle, and I know I can check how long since last reboot with uptime, but I'm curious if there's a way to see how long since my ...
2
votes
3answers
831 views

Applescript app to shut down Mathematica at a specific time of day

I have the following workflow that I need to execute on a daily basis for a period of days: The computers start at a specified time, Mathematica and a specific Mathematica notebook launch and ...
2
votes
3answers
938 views

How to add a Safari toolbar button that runs an AppleScript

How do I add a button to the Safari toolbar that, when clicked, executes a given AppleScript?
2
votes
1answer
251 views

Launch Genius via AppleScript

I would like to launch a Genius playlist for the currently playing song in iTunes via an AppleScript. A prerequisite would be for the script to work when iTunes is in full screen. And ideally, it ...
1
vote
1answer
1k views

Deleting all songs in a given iTunes playlist using Applescript

I'm working on a script to manage my "queue" playlist in iTunes and wanted an easy and fast way to quickly delete all songs in that playlist. Applescript seemed the best option and I created a little ...
1
vote
2answers
238 views

Open a folder in default browser

I have many web projects that I develop on the localhost. Normally to get to these one has to navigate from the root directory or bookmark the url. I want to be able to open an OS directory/folder in ...
1
vote
2answers
529 views

Launch Final Cut Pro, make a new project and name it with Automator

I want to make an Automator app that will do a couple of things for me with Final Cut Pro: I want it to ask me to name a the new project (we will call it test1) Then I want it to make a new folder ...
1
vote
2answers
3k views

How do I run an OS X command script on remote Xserves from a desktop OS X script?

The answer to an earlier question, Access and control home office network, iMacs, and Xserves, left me with a new problem. To review, I have a computing environment comprised of: 27" iMac with dual ...
2
votes
2answers
841 views

Applescript to kill open applications and log out user after 30 min. of inactivity

I'm looking for a way to automatically log off a user after 30 minutes of inactivity, as well as close all open applications. As of now, there is really only one user to deal with. I'd prefer an easy ...
0
votes
2answers
526 views

Is there a dial from Addres Book and tel:/sip: protocol handler script/application available for 10.7?

We are currently using Mac OS X 10.6 and snomURLHandler to convert tel: uri's to a http GET request. This computer telephony integration let us click on a telephone number in Address Book.app and let ...
1
vote
1answer
150 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 ...
4
votes
2answers
821 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?
4
votes
2answers
3k 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 ...
0
votes
1answer
338 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
504 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 ...
2
votes
1answer
331 views

How do I enable “Announce the time” programmatically?

The "Date & Time" System Preferences pane has an option to "Announce the time". I'd like to be able to turn on this preference option by invoking a shell script. Is this possible? (It's fine if ...
0
votes
2answers
751 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 ...
1
vote
1answer
233 views

How can I remove the Job Title and Company from all Address Book contacts using AppleScript?

I would like to remove the Job Title and Company from every contact in my address book using AppleScript. Any ideas?
3
votes
1answer
443 views

I want to run an applescript whenever a certain person signs onto my Messages buddy list

I want to run an applescript whenever a certain person signs onto my Messages buddy list Exactly. Thats exactly what I want. Pretty self explanatory. I am aware you can run applescripts for messages ...
5
votes
1answer
11k 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" ...
1
vote
1answer
400 views

An iTunes Applescript that appends to tag only when it doesn't match part of the tag string?

I'm trying to find a way to add a keyword or group of words/tags/strings to a set of selected iTunes tracks if they haven't been added. A use-case would be to add extra metadata in a comment such as ...
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
504 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
2answers
1k views

Automate PDF actions

To improve my paperless workflow, I'm looking to achieve the following, potentially using automator / applescript. I need to be able to run it using Hazel, or as a folder action (not run manually): ...
1
vote
1answer
155 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 ...
0
votes
2answers
2k views

Setting a automator action to run everyday

I have an automator action that downloads file from our server. Easy enough to setup but can't quite sort out how to set it so it will operate automatically at a certain time everyday. Tried hooking ...
1
vote
1answer
454 views

Mail.app AppleScript to process POP3 mails stopped working in Lion

I have a Mail.app rule script that worked fine in Mac OS X Snow Leopard. It is simply a script that allows for AND/OR boolean logic combined together to trigger one (rarely two) of the following ...
3
votes
1answer
567 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, ...
11
votes
4answers
5k views

Creating an automated HFS+ compressed folder

I would like to set up an automated way for archiving files in OS X Lion. By archiving I mean using HFS+ compression feature on a specific folder, and make every file that I move into this folder ...
2
votes
1answer
566 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
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 ...
0
votes
2answers
1k views

How do I display a hyperlink with an AppleScript?

I am trying to get a URL via AppleScript, then displaying it as a clickable link via a window. How do I do this? (if I need to use Xcode for this, please add the answer, but provide detailed ...
2
votes
1answer
3k 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
96 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 ...
2
votes
1answer
847 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 ...
6
votes
3answers
4k views

Change the default application (for a file extension) via script/command line?

Is there a way to define the default application for a file extension via an Apple script, command line command (like defaults write [...]). I know that you can change it manually via the information ...
7
votes
1answer
492 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 ...