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
1answer
348 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
154 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?
2
votes
1answer
388 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 ...
2
votes
3answers
511 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 ...
1
vote
3answers
700 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
640 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
214 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
829 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
209 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
404 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
2k 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
685 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
383 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 ...
0
votes
1answer
107 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 ...
3
votes
2answers
439 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?
3
votes
2answers
2k 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
314 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. ...
3
votes
1answer
374 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
302 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
543 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
175 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
396 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 ...
3
votes
1answer
7k 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
328 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 ...
9
votes
4answers
3k 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
346 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
140 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
412 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
484 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, ...
9
votes
4answers
3k 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
478 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 ...
1
vote
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 ...
3
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
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
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 ...
2
votes
1answer
594 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
3k 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
425 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
766 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 ...
2
votes
1answer
944 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 ...
1
vote
1answer
1k views

Automator workflow or AppleScript to close Safari after a period of time

I would like to create an Automator workflow (or some similar function) that will close down Safari after a specified period of time. For instance, I simply want to run Pandora in Safari during the ...
1
vote
1answer
166 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
905 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
113 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)?
8
votes
1answer
3k views

How do I find out the applescript commands available for a particular app?

I'm trying to find out if I can get iTunes to do something complex, but don't know what can be scripted. Is there a way to find out what applescript commands an app will respond to?
3
votes
1answer
1k 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.