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
11k views

Converting HTML to PDF using convert utility in Mac OS X

I'm trying to convert a bunch of HTML files into PDF files. I'm looking for an automated solution so that i don't have to open each HTML file individually and convert it to PDF. In Mac OSX, convert ...
3
votes
4answers
2k views

Can Python/Ruby/Perl/etc (or even bash) replace AppleScript?

I'm not inviting people to hate on AppleScript in general; I'm just wondering if what makes AppleScript useful can instead be used by other general-purpose scripting languages. I.e., Lion & Mac ...
3
votes
3answers
6k views

Applescript to retrieve account and password using keychain scripting

How can I use keychain scripting to write a script in Applescript that retrieves the login and password of a website from the login keychain, given the website's URL?
3
votes
2answers
2k views

Allow application to control computer (assistive devices) on Mavericks via Terminal?

I'm currently working on automated instalation of Mavericks 10.9. I have NetBoot set up. Everything works OK untill I want to execute Applescript. Since the release of new version I need to manually ...
3
votes
2answers
369 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 ...
3
votes
6answers
9k views

Mail.app in Lion - is there a way to create tasks from email?

I'm not sure if I haven't seen that in earlier versions of Mail.app, but I would really love to have the ability to create a task in iCal from an email - and that this task could link to the original ...
3
votes
3answers
3k views

Software to record and playback mouse movement/clicks and keyboard presses?

I was wondering if there was any software out there that could record mouse/keyboard input and allow you to play back the input that was made? I've tried using Automator but for some reason it's not ...
3
votes
2answers
2k views

Osascript error

I was messing around with some external libraries, and for some reason when I enter any Osascript command, I now get this error (before it did work): 2011-09-07 19:13:43.306 osascript[1083:707] ...
3
votes
5answers
7k views

How can I write a script to open multiple terminal tabs and execute code in them?

I want to be able to open the terminal application and have it either automatically run a script that opens several tabs and run an arbitrary set of commands in each. For example I would like one tab ...
3
votes
2answers
484 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
8k 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
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 ...
3
votes
2answers
127 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
173 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
106 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
1answer
127 views

Can't save AppleScript file when created by touch

I'm used to create file using touch before opening them with open. But I came to this following problem : When I do this with AppleScript files AppleScript Editor is able to open the file but unable ...
3
votes
2answers
626 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
2k 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
386 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
1answer
45 views

Variable not defined not sure why

For some reason "the name of thePath" comes up as not defined by my automator workflow. on run {input, parameters} tell application "Finder" set thePath to the (first item of the input) ...
3
votes
2answers
2k views

Passing a password to an Automator application

I have written an Automator application with the following shell script to open an FTP connection on my system: sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist osascript -e 'tell ...
3
votes
4answers
454 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
983 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
1answer
328 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
228 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
3k 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
567 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
787 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
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.
3
votes
2answers
167 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
391 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
138 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
145 views

Is it possible to submit not sandboxed app to the Mac App Store

I have an AppleScript Cocoa application that does a lot of shell scripts like kill or chflags. Is there any way I can try to send it on review to MAS and get it approved? According to Wikipedia: ...
3
votes
1answer
135 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
2k 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
100 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
799 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
407 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
254 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
134 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
329 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
548 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
403 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 ...