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
2answers
399 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
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" ...
3
votes
2answers
112 views

Use one AppleScript to toggle on and off (1 or 0)

I'm wondering if there's a simple way to use one AppleScript program to turn something on and off. Basically I want it to do this. Check current pmset sms if sms = 0 then do shell script sudo ...
3
votes
1answer
125 views

Display IP address in an Automator alert

I am running an Automator script to launch SFTP on my Mac when double-clicked. Here’s the script: do shell script "sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist" with ...
3
votes
2answers
66 views

How to close applications on sleep?

I have a password management application (KeePassX) of which backup I sync over Dropbox across several computers. However the password database can be open only on one computer at a time for file ...
3
votes
2answers
449 views

Emulating associative arrays in AppleScript

A problem that would be trivial to solve with key=>value pairs. For each item in list_a, find the matching item in list_b and compare a single attribute (calculate scale ratio for two sets of images). ...
3
votes
1answer
1k views

Save attachments from Mail.app based on subject

I have been trying to write an Applescript to help me saving attachments, but realized quickly that I do not have the knowledge to do such a difficult script. Here is some background. We receive ...
3
votes
1answer
1k 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 ...
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 ...
3
votes
1answer
344 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 ...
3
votes
4answers
263 views

AppleScript: Press Enter Every X minutes If Terminal is Open and Application Has Been Idle for X Minutes

I am new to AppleScript and am attempting to use it. If I am using Terminal and if I have not pressed a key for x minutes I want my Mac to press the return key. It is to repeat this process every y ...
3
votes
2answers
625 views

Automate taking a screenshot of specified area

I am trying to use automator to take a screen shot of a specified area. Though I can only find the option of taking a screenshot of a windows or the entire screen. Is there a option to to this with ...
3
votes
3answers
1k views

Find a specific file with automator

The basic question is: How can I pass a filename to the Spotlight search module in Automator? The essential problem: I have hundreds of broken aliases scattered throughout a particular ...
3
votes
2answers
2k views

How can I stream audio to multiple computers at the same time?

I'm trying to stream music to different computer's speakers simultaneously. Currently I'm doing this by physically timing the start of the song on each computer. Are there any built in utilities or ...
3
votes
1answer
262 views

“@” symbol in password in applescript

I am using an applescript to mount a users home folder. However, when I use a password with a "@" symbol the script fails since the "@" symbol is also the separator between the password and ...
3
votes
2answers
204 views

Have Voiceover read out just paragraph or sentence under cursor

I work with a disabled user who controls their iMac using keyboard and mouse input from their communication-aid. They have dyslexia and would like to use voiceover to read certain paragraphs or ...
3
votes
2answers
2k views

Applescript click automation in Google Chrome browser?

Hello fellow programmers! I would like to save some applescript code as an application, so that when I open the application it will go to Google Chrome and answer an incoming call in Google Voice. I ...
3
votes
1answer
469 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
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
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 ...
3
votes
1answer
731 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 ...
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.
3
votes
2answers
161 views

LaunchBar script that returns the path of a folder “dropped” on it

I want to make a LaunchBar script that displays in a dialog the path of a file or folder that's chosen in the first pane and then "dropped" on a script. But I can't make it work. I've got a couple of ...
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 ...
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: ...
3
votes
3answers
360 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 ...
3
votes
1answer
3k views

how to send scheduled mails with Mail?

I would love to send mails in my apple mail scheduled! What is the most comfortable way to do that? only method i found: http://homepage.mac.com/aamann/Mail_Scripts.html (but this is quite tricky + ...
3
votes
2answers
77 views

Mirror number of unread mails in title bar

Is there a way to show the exact number of unread mails from the Mail.app icon also in the title bar? Note that this is not the same as showing the number of unread mails in inbox, since I can change ...
3
votes
1answer
112 views

Apps using significant energy terminal/applescript

Does anyone know how to access the "Energy Impact" data used to determine "Apps Using Significant Energy" displayed in the battery menu bar? I'd like to use it in a shell-script/applescript.
3
votes
1answer
1k views

Show Results of Automator-Terminal command

TL;DR If I create a .app via Automator, how can I show results of a shell script in a dialog or terminal window? I am using Automator to run a shell script adb install /Directory/$1.apk and if I ...
3
votes
2answers
95 views

Cleaning up birth years 2000 in my Address Book

A few years ago (or actually, more likely, in 2000), for some reason, birthdays that didn't have a birth year (but did and do have correct month and day) were automatically given the birth year 2000 ...
3
votes
1answer
645 views

How to use environment variables in applescript

I'd like to use my environment variables, which were defined in my environment.plist file, in my applescript. How do I do that, for instance: log "Glassfish Home: " & AS_HOME Where AS_HOME is ...
3
votes
1answer
304 views

Are there more robust tools than Automator to extract text from multiple PDF?

There is an action in Automator that allows you to programmatically "Extract PDF Text", but it fails when fed a moderate amount of files (25 to 100). Worse, it fails without logging anything helpful ...
3
votes
1answer
221 views

Is there a maximum length of metadata that can be written in one xattr command?

Is there any text length limitations for how long text can be put to xattr? I plan to put my AppleScripts source code to script files so Spotlight can find it. Using Finder Comments isn't an option ...
3
votes
1answer
129 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 ...
3
votes
1answer
291 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 ...
3
votes
1answer
489 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 ...
3
votes
1answer
378 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
474 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, ...
3
votes
2answers
526 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 ...
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 ...
3
votes
2answers
1k views

Is it possible to disconnect a bluetooth connection using Applescript?

I want to disconnect a connection to a bluetooth device through an Applescript. Please note that I don't want to disable or enable bluetooth, I just want to disable one specific connection.
3
votes
1answer
589 views

Passing selected folder path to custom Service executing AppleScript

I have a custom Service I created in Automater. Right now, the service shows up in my context (right-click) menu, when right-clicking on any folder. In Automater, I added the Run AppleScript action, ...
3
votes
2answers
53 views

How to run Say “something” in background in AppleScript

I would like to have AppleScript code like this: row 1 say "some long text here" row 3 When it starts to speak text, it same time continues to row 3. I create my scripts in AppleScript Editor and ...
3
votes
1answer
137 views

How can I get my AppleScript code to move files?

Having used Automator to organise files by file extension successfully before, I decided to create an AppleScript application that will save me having to change parameters manually, as Automator ...
3
votes
1answer
81 views

Tell application screen is not zoomed

When using OS X's native zoom, is there any way (perhaps using AppleScript) to fool an application into thinking the screen is not being zoomed? Something like tell application "System Events" to ...
3
votes
2answers
132 views

Unaccent Special characters and bulk-rename

Background I have a workflow that collects documents from various sources, converts them to PDF, OCRs them, compresses them, extracts their contents and annotations, uploads the files to a server and ...
3
votes
1answer
77 views

Log software usage time on Mac OS 9 (Oct. 1999)

I'm needing to log the time a user spends inside of an application in Mac OS 9. I created a simple bash script "launcher" to do this, but then discovered OS 9 doesn't have bash installed. Here is the ...
3
votes
2answers
501 views

Can AppleScript be used to downloading files from a web page?

I want to write a script that searches a web page for an updated file, then downloading it when detected. There is no command I have found that does this, accept Automator's download URL function, ...
3
votes
1answer
973 views

Toggling screensaver password with script

I am using a rather old application called Proximity to trigger applescripts when my phone goes in and out of bluetooth range of my mac. Along with other tasks, I want to secure my laptop when the ...