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

learn more… | top users | synonyms (3)

1
vote
1answer
46 views

Move Photos from iPhone to iPad

I have to help someone do this, so I do not have the devices in front of me to play around with. There are three devices involved: Macbook (don't know what model) iPhone (don't know what model) ...
1
vote
1answer
144 views

Using AppleScript to find information about images in Pages documents

I'm trying to extract information about images placed into a Pages ('09 v 4.3) document. The following script is my attempt: tell application "Pages" tell front document repeat with pg in ...
0
votes
1answer
653 views

Start screensaver/ lock screen on screen sharing disconnect

Is there a way with an AppleScript or shell script to start the screensaver when you disconnect from a screen sharing session? For example, I connect via screen sharing from Mac A to Mac B. When I ...
1
vote
0answers
239 views

AppleScript to file attachments

I'm trying to file email attachments into a specific folder. The path is received in the subject field of the email. I'm close but not quite there. I am getting the script to run. using terms from ...
1
vote
1answer
1k views

A turning gear appears when I run this workflow, why?

I am running the following script (called Restart AppleTV) using automator : on run {input, parameters} do shell script "sudo killall coreaudiod" with administrator privileges return input end ...
2
votes
2answers
1k views

How to swap command and option modifier keys with a script in OS X Lion

I use a PC usb keyboard with my macbook. So, I've gone into System Preferences > Keyboard > Modifier Keys... and swapped command and option for the usb keyboard. This puts those keys in the ...
1
vote
2answers
433 views

Shell or Applescript to delay shutdown?

We have a workstation that gets used sporadically, and I'm trying to setup a script that backs it up during shutdown. I created a LogoutHook in com.apple.loginwindow to a 1-line bash script, that ...
1
vote
1answer
402 views

Launch App with Automator when system is idle

My idea is to dim the display when the system is idle for 10 seconds, and with a keystroke or trackpad activity revert to original (I want to preserve battery automatically and not using a screen ...
0
votes
2answers
696 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
184 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
726 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
245 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 ...
15
votes
3answers
17k 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
1k 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
141 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
898 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
76 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
196 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
146 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?
5
votes
3answers
4k 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
62 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
77 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 ...
1
vote
0answers
887 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
881 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 ...
1
vote
1answer
2k 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
126 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 ...
2
votes
1answer
444 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
111 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
632 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 ...
2
votes
1answer
774 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
36 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
1answer
499 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
451 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
383 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
517 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
1k 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
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
315 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
128 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
55 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
5k 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
209 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
146 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
167 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
341 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
123 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
245 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
72 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 ...