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
383 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
971 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
333 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
2answers
251 views

Automating ffmpeg using Automator Service

I often use ffmpeg off the command line to convert video files into mp4 on my Mac (running Mavericks). Do note, however, that I am NOT re-encoding my videos; am just changing the container from an avi ...
3
votes
4answers
229 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
567 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
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
250 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
199 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
1answer
447 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
716 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
149 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
3answers
352 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
71 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
106 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
986 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
94 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
3answers
970 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
1answer
611 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
285 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
207 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
126 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
279 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
480 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
368 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
467 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
523 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
991 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
583 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
43 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
90 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
80 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
111 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
2answers
678 views

Automator app with a menubar icon

I've created an application with Automator. I want to have a new icon in the menubar like this: Which starts the app when I click on it. Is it possible? (without using Xcode) PS: I don't ...
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
1answer
907 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 ...
3
votes
1answer
99 views

Running an AS droplet from Terminal

I have an Applescript Droplet application that I need to run from terminal. I can use osascript or even just open to open the AS App, but that will run its on run handler, not the on open droplet ...
3
votes
1answer
324 views

Applescript - Connection is invalid

I have an application for mac and I use the following applescript code (exported as an AS app) to start that app periodically: on idle tell application "System Events" tell application ...
3
votes
1answer
544 views

Can I send Notification Center items to my iPhone using Pushover or Prowl?

The title pretty much sums it up. I often feel like having notifications on my iPhone are a lot easier to notice, especially if you step away from the computer for a few moments to do something and ...
3
votes
1answer
2k views

How to avoid the GUI password prompt when using `osascript`?

I’d like to use the osascript shell command to run some AppleScript, but I’d rather avoid the GUI password prompt. Instead, I’d prefer to run the script as sudo from the command-line, so no GUI ...
3
votes
1answer
447 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
1answer
615 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 ...