AppleScript is a proprietary programming language in Mac OS X to control and exchange data with applications.

learn more… | top users | synonyms (2)

0
votes
2answers
224 views

AppleScript: Find all instances of “Folder” and list the contents in a drop down box/list

I'm trying to make a script I can use to find all instances of a folder, be it on the root drive, external drive or mounted networked storage, and list all the contents in either a drop down box or a ...
0
votes
1answer
93 views

AppleScript: Check if “System Events” has loaded

When an Active Directory (AD) user logs in, my AppleScript fires and attempts to put their AD home directory in the sidebar for easier access when opening and saving documents. It works great, but ...
0
votes
3answers
263 views

Run applescript as a service

I have the following applescript bundled as .app (using Platypus) and starting on user logon (12.4 MB for each user) #!/usr/bin/osascript -- INICIO DAS FUNCOES EXTRAS set app_path to path to current ...
1
vote
1answer
67 views

How to script number pad key

We use an auto login script using ARD to avoid visiting each station in our lab. Mountain Lion no longer works so that a cursor appears at the login screen. I've tried numerous scripts to activate the ...
6
votes
2answers
3k views

Run AppleScript from bash script

If I wanted to run an AppleScript from within a bash script I could call a file with the list of commands that I require to execute. #!/bin/bash {some commands} osascript file.scpt {other commands} ...
4
votes
2answers
703 views

Bash Script that will start up second Terminal process?

I need a script that will be able to fire up a second Terminal instance and pass a command directly to that one whilst it continues it's own executions. It's to start up Python script that will host ...
1
vote
1answer
49 views

POSIX path returns strange path?

I was writing some AppleScript code when I came to the following result : tell application "QuickTime Player" set paths to file of document of windows get paths repeat with theItem in paths ...
2
votes
3answers
206 views

Automator: Correct syntax for calling an AppleScript file

I'm attempting to write an Automator application that will mount an external disk. I have an AppleScript that does the job and I'm attempting to insert it into an Automator application. However, ...
0
votes
1answer
58 views

How can I make a .command file that I can share without giving permissions on each computer?

I have a terminal command that I would like to run. telnet 169.254.216.127 54326 Ideally I would like to convert this into a .command file and be able to share it with many other mac users ...
1
vote
0answers
104 views

Script to make the x red button kill the app

Quick background: new mac, long time windows user; not scared by linux and scripts. I am currently using RedQuits to make the x red button quit de app, not just close the window. It is a great ...
1
vote
2answers
72 views

Can SteerMouse sensitivity be automated?

I have to adjust the cursor sensitivity in SteerMouse every time I switch between my home mouse and my work mouse. Is there a way to do this programmatically?
4
votes
3answers
640 views

How can I swap the primary display automatically in a dual-monitor setup?

I have a MacBook Pro and two Thunderbolt displays at work. I work with the MacBook lid-closed because it's overkill and I don't have enough desk space anyway. Every morning I show up to work and plug ...
1
vote
0answers
32 views

Can Homebrew be used to install AppleScript bundles?

Can Homebrew be used to install AppleScript bundles? If so, what sorts of conventions would the project need to follow? Would it need to include a make.scpt file compile the .applescript files? I'm ...
1
vote
2answers
55 views

Boot straight into an application without showing the desktop

How do I boot straight into an application without showing the desktop? Essentially I would like to turn the machine on, see the grey screen with loading icon, and then see my application. The ...
0
votes
0answers
155 views

Help to create an apple script to send a message to multiple Jabber rooms in Messages on 10.8.3

I am trying to create a script to send the same message quickly to multiple chat rooms on a Jabber server. Here is what I have so far: display dialog "Please type your message" default answer "" ...
1
vote
0answers
303 views

Applescript to forward email with attachment, and change subject

I'm trying to create an applescript that will take messages that match a certain filter YYYY), and forward them to a specific notebook in Evernote (XXXX), with the attachment intact. So far, I've ...
1
vote
1answer
199 views

How to write AppleScript for clicking an OK button on a custom dialog?

I have done a script to quit program: tell application "Live" quit end tell …but I get this prompt to click the OK button: I am running my Mac for schedule shutdown as it is running for an ...
0
votes
1answer
542 views

AppleScript Setting Select Drop Down

I am trying to enable dictation with applescript and so far have the following that works. But, how do I set the drop down for the shortcut key using AppleScript? Below is the AppleScript code: ...
2
votes
1answer
80 views

Removing only birth years from a group in my Address Book

A lot of my contacts (600+) had somehow got their birth years set to 2000. Their birth months and days are correct, but the 2000 is wrong. With the tremendous help I got here, I was able to get them ...
1
vote
1answer
212 views

How can I change Contacts.app custom labels automatically using AppleScript?

Is there a way to change the current labels in Contacts.app to custom ones using AppleScript based on a specific criteria? Here is what I mean: I need the script to go through my contacts to change ...
3
votes
2answers
87 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 ...
0
votes
2answers
268 views

Restart OS X if an application has crashed/is not responding/beachballed?

How can I automatically restart the machine if an application has crashed in any way? It might have cleanly exited, have a quit unexpectedly error, or be frozen with the spinning beachball. I don't ...
1
vote
1answer
185 views

Launch Dictation With Applescript

I would have thought this would be easy to find, but thus far it has not been for me. Is there a way to launch dictation (fn, fn) with applescript or from the terminal?
1
vote
0answers
29 views

AppleScript bundle: expose other interactive scripts?

Assuming that I've created script bundle (.scptd), is there a way to expose (for lack of a better term) other interactive scripts? Alternate scripts might preform configuration tasks or secondary ...
4
votes
0answers
224 views

Printer Deploy with and custom preset profiles to Mac OS X workstations

How would I go about deploying a network printer (Sharp MX-2600N) to Mac OS X machines that would include a custom printer preset profile (Embedded Printer User Authentication Code)? Ideal Method of ...
0
votes
1answer
161 views

Access OS X Mail message by its ID

I am trying (unsuccessfully) to get a Mail message (located in the 'Drafts' folder) by its message id. The following code: set theContent to getContent(123456) on getContent(theID) tell ...
2
votes
0answers
190 views

AppleScript to find old mail messages is slow in ScriptEditor

So I have an AppleScript that iterates over all the messages in various mailboxes and finds messages which meet various criteria and moves them to Deleted Items. The mailboxes in question are ...
1
vote
1answer
299 views

Trouble with Applescript/Xcode setting up VPN Auto Connect with Btguard's Tunnelblick Open VPN

I followed all of the all of the steps in this link How to auto connect to VPN upon login/boot?. I tried a number of times, changing the service from "BTGuard VPN" to "Tunnelblick VPN" to "BTGuard", ...
5
votes
1answer
617 views

How to click button with applescript using UI Element Inspector

I am new to applescript. I am trying to open a webpage, and click a button on that webpage. here is my script: tell application "Safari" to activate tell application "System Events" tell ...
2
votes
2answers
551 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
132 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 ...
1
vote
1answer
324 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
50 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
47 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
932 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
110 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 ...
0
votes
1answer
74 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
102 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
191 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
56 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
73 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
38 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 ...
3
votes
3answers
732 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 ...
0
votes
1answer
321 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 ...
3
votes
6answers
418 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
82 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
292 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
101 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
238 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
152 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 ...