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
2answers
2k views

Relative path in Automator

I want to make an Automator action that copies a set of files from a folder to another folder that is one folder up and then two folders down from the original files. In other words: ...
1
vote
1answer
301 views

Specify AppleScript bundle icon

I'm trying to assign an icon to my AppleScript bundle, but without success. Steps: Added the icon (applet.icns) to the bundle's /Contents/Resources directory Modified the bundle's ...
2
votes
1answer
1k views

Find Record with List by key in AppleScript

Is there way to get a Record by the value of one of its keys without looping? I've been doing this: set theKey to 22 set theRecords to {{key:11, value:"foo"}, {key:22, value:"bar"}} repeat with ...
2
votes
0answers
127 views

AppleScript deployment conventions?

I haven't seen a package-management system for AppleScripts, but it seems like the foundations for one are present. Given: Scripts (and folder) located in the ~/Library/Scripts/Applications folder ...
1
vote
0answers
54 views

Is there another way apart from screencapture to take a screenshot of a background window?

I'd like to take a screenshot of a background window given its title. I know this can be made with screencapture -l idwindow output but unluckily I can't use this method because I'm on a 10.5.8 ...
1
vote
3answers
4k views

Get components (path and filename) of POSIX filepath

Given: ~/Desktop/Foo.scpt contains: (POSIX path of (path to me)) as text Which returns: /Users/[username]/Desktop/Foo.scpt How do I get path /users/[username]/Desktop/ and the file name ...
2
votes
1answer
207 views

A script to automatically split an Aperture library

My Aperture library contains a ridiculous amount of pictures (well over 30 000) which means it is extremely slow whatever the hard-drive and computer I use. I want to split my library into separate ...
1
vote
1answer
144 views

How to tell if iTunes in the mini player mode from applescript

Is there a way to tell if iTunes is in mini player mode from applescript? Using Mac OS X 10.8.4 Mountain lion.
2
votes
2answers
164 views

Add AppleScripts to Git repository

I have a few AppleScript files that I would like to share with the community on GitHub. The files are located in two distinct directories: ~/Library/Scripts ~/Library/Application ...
5
votes
3answers
329 views

Set a keyboard shortcut to clear all tracks from the Up Next queue in iTunes

I am looking for a way to assign a keyboard shortcut to clear all the tracks from Up Next queue of iTunes. Does anyone know a way to do this? Using Mac OS X Mountain Lion 10.8.4
0
votes
1answer
121 views

Enumerating messages in Outlook's Drafts folder generates an error

I would like to enumerate the messages in Outlook's 'Drafts' folder. When I run this script: tell application "Microsoft Outlook" set theMessages to every message in the drafts --returns 1 ...
0
votes
1answer
235 views

Applescript Replace sub-procedure doesn't work with '@'

I'm trying to substitute an email address for a symbolic character in a block of text. The text block: Dear %%FirstName%%- ... This message was sent to %%EmailAddress%%. The script: ... set ...
0
votes
1answer
71 views

Applescript sub-procedure problem

I would like to display a comma-delimited list of values in a List. Unfortunately, I get an error that reads Microsoft Outlook got an error: Can’t continue joinList. when I attempt to use the ...
4
votes
3answers
2k 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 ...
1
vote
1answer
671 views

How to make Rsync copy alias files?

System specs: 2011 iMac, OS X Mountain Lion 10.8.4 I have come to understand that Rsync does not handle Mac Alises properly, and have now discovered that hundreds of aliases I've previously copied ...
4
votes
6answers
3k views

How to make an existing AppleScript file to work as a service?

I made an AppleScript, saved it as a file in a specific folder on my hard drive. Now I want to assign a shortcut to it and looks like I have to make a Service via Automator, but the Run AppleScript ...
3
votes
1answer
217 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 ...
1
vote
2answers
1k views

Applescript failing even though variables are equal

I have a file that is a list of numbers like so: 01 02 03 04 ... 241 242 However, this was generated from a list of files so I am not sure if it contains all the ...
2
votes
1answer
273 views

Access messages in Outlook's 'Drafts' folder

I would like to use a message that is stored in the 'Drafts' folder as a template for other messages. Unfortunately, I don't have the correct syntax: tell application "Microsoft Outlook" -- ...
5
votes
3answers
498 views

How do I create a Folder Action Script to tar items dropped in folder?

I would like to drop/copy files/folders and have them compressed then copied to my desktop. This is what I know so far... and it isn't much so any help would be appreciated. on adding folder items to ...
1
vote
2answers
347 views

Why does iterating over a list in applescript with `repeat with … in` fail with error code `-1731` part way through the list?

I have this script for ensuring that every track in a given smart playlist is both shufflable and bookmarkable. The script is inteded to be launched via launchd. All of this is set up fine except ...
0
votes
1answer
364 views

Applescript - Run Multiple Instances of an App in Mac OSX

I was hoping one of you kind folks could help me write a script that would open another instance of Transmission. From my online research, I took a stab at making my own and compiled the following ...
1
vote
1answer
157 views

System event key codes not working on thunderbolt display

My AppleScript works when I am just using my MacBook Pro Retina, however if i have my Thunderbolt Display attached the script does not work. Here is the script which works perfectly on just the ...
3
votes
2answers
980 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). ...
1
vote
0answers
369 views

Progress Indicator for AppleScript

Okay, so I have an AppleScript that is really just a wrapper for a simple shell script, so I could turn it into a double-click to run application, droplet and URI handler on OS X. Anyway, this works ...
1
vote
1answer
219 views

Applescript IF statement with click and keystroke?

I would like to make a script that press down the shift button every time i click on something and maintains it pressed until I release click. Something like: If click then key down shift "when click ...
0
votes
1answer
166 views

Open contact group on Mac

I just want to use AppleScript to open an existing group in Mac Address Book (v7.1). tell application "Contacts" set selected of group "friend" to true activate end tell above is the sample ...
0
votes
2answers
445 views

AppleScript - more than title

I have a AppleScript that runs from a cron job. The script is: tell application "System Events" set frontApp to name of first application process whose frontmost is true end tell tell application ...
0
votes
1answer
253 views

How to ask for a mail folder in applescript?

I apologise in advance since this will be a long question. I hope that somebody with applescript knowledge can help me. I am transferring whole of my Windows machines to Apple and I am stuck with one ...
1
vote
1answer
1k views

Applescript - the activate command makes application “half-active”

What I did: Using this link, I created the following Applescript: tell application "System Events" click (first button whose subrole is "AXZoomButton") of (first window whose subrole is ...
2
votes
3answers
5k views

What is the Applescript command to show or hide iTerm2 window

Does anybody know the Applescript command to show or hide a iTerm2 terminal window? I use iTerm2 in a guake style command window and currently using one window and many tabs. My use case: I managed ...
3
votes
1answer
2k views

Set size of window to exact pixels, and place via x, y coordinates

I would like to create a tool that allows you to set windows to exact sizes on the pixel scale to be able to have more precise screen divisions. For example, if I had four Terminal windows (and I ...
1
vote
0answers
21 views

Possible to Detect All the Podcasts in iTunes That Are Marked to Not Allow Auto Delete?

I'd like to, for my own nefarious reasons, be able to see which files iTunes currently thinks it can't auto delete. Applescript or summat would be fine, although a smart playlist would be even ...
0
votes
1answer
60 views

How to get Mail.app raw message in the Automator?

This is an cross-post, because i'm not sure where it really belonging. It is programming question, but apple specific question too. Here is the stackoverflow link: ...
0
votes
2answers
993 views

Script or workflow to modify find and replace text in clipboard

I need give unique names to many, many files as part of my job. I download dozens of PDFs from a research database which all come with the same name (date of download). I have to open the file, select ...
2
votes
1answer
42 views

How can messages be scripted whenever I open a specific application?

Say I want to start Safari on my Mac. Can I create a pop up message that reads, "Use Chrome instead" or some other thing? I presume it may be possible with Applescript or something, but don't know ...
1
vote
1answer
544 views

Copy and Paste files into the same directory using Terminal

I am currently trying to figure out how to Copy and Paste files (more than one file) into the same directory using Terminal. I am trying to create a script to create the same file. If there is a ...
1
vote
1answer
361 views

Applescript to delete iMessages from Messages app

I have an Applescript that sends myself and colleagues iMessages when certain events happen. Some times hundreds of iMessages are sent in a short space of time to lots of people and the Messages app ...
1
vote
0answers
91 views

Apple script that closes Apple Remote Desktop

First let me say that I have ZERO experience in Apple Scripting. That said, I need to build a Apple Script or whatever is more efficient for that case, that is going to close Apple Remote Desktop ...
1
vote
0answers
148 views

How does one execute scripts within script bundles?

I am trying to make my completely enormous script more comprehensible by splitting it into a main script with bundled scripts to run when called, but I don't seem to understand how to run a bundled ...
0
votes
1answer
364 views

Expand Sending Email with Applescript

I read with interest the article regarding sending an email based upon parsing through a csv file to pick up the name and email address. This looks like most of what I need to accomplish my objective ...
0
votes
3answers
2k views

How Can I Create a Multi-Line Input Dialog using Applescript?

How can I create a multiline text input dialog using Applescript? Creating a single line dialog is simple...
1
vote
1answer
155 views

creating a resident workflow with automator

I currently have a simple workflow that gets the contents of the clipboard and creates a new text file from those contents on the desktop. problem is, i have to run the workflow everytime i need my ...
0
votes
1answer
632 views

How do I remove the Finder from the Dock automatically at login?

This is related to this question here, except that, in addition to removing the Finder, I want to do it automatically. There are several solutions on the web that suggest using this AppleScript: tell ...
1
vote
1answer
489 views

Messages applescript not working under Mountain Lion?

Tried adding an AppleScript to run a specific command when I'm sending or receiving a message in Messages on my server, but for some reason it never seems to get called. Placed it first in ...
0
votes
2answers
410 views

Mac OSX Apple Script, How do I make Apple Script push keys on an application

What I am trying to do is make my character run up 50 steps then down 50 steps repeatedly using the up key and the down key. I know how to utilize system events to push keys and I know how to tell ...
1
vote
2answers
731 views

Why does this Applescript often fail the first time, but always work after that?

The following Applescript opens a menubar app called QuickHue and then clicks a specified item in the menu. Often, when I use the applescript, it does nothing. But if I wait a moment or two and try ...
2
votes
1answer
129 views

Send mail after found new items inside the folder

I am running an applescript application using stay open option. Function of the script is: the applescript will ask for "javascript" to run the below is my code. the functions of the javascript is ...
0
votes
1answer
108 views

Applescript, quit app if other app is quit

I have a (very basic) apple script that I use as a trigger to start and hijack Plex, using Audio Hijack Pro. tell application "Audio Hijack Pro" start hijacking session named "Plex" end tell tell ...
1
vote
2answers
226 views

How do I invoke a service using Applescript?

I'm using Circus Ponies NoteBook which doesn't support Applescript methods. It does support creating services that can clip the current selection into a NoteBook page. This allows me to select text ...