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
1answer
153 views

How to select message in Mail with ID using AppleScript?

With the help of "Ask Different" I got my first AppleScript program working, and I'm trying to improve it. I'm again stymied though. I have found the message number ID of a particular message in my ...
1
vote
2answers
396 views

AppleScript for counting messages in Inbox fails with “Can't get mailbox”

Here is my first attempt at an AppleScript program, which met with ignominious defeat: tell application "Mail" tell mailbox "INBOX" count messages end tell end tell It compiled, but ...
2
votes
2answers
85 views

How can I automate GIF to PNG with Preview using AppleScript?

I have a GIF file but I can open it only with Preview because it is a little bit ruined (GIMP or other programs does not open it correctly but it works with Preview). I want to export it to PNG ...
1
vote
1answer
73 views

AXSelectedRows: Getting selected rows for AXOutline

I feel that AXSelectedRows has finally beaten me into submission :) After extensive research, I am stumped as to how to programmatically list the contents of AXSelectedRows; simply put, to get the ...
1
vote
1answer
89 views

Transfer labels (“tags”) from a SMB share to an AFP share

I had a SMB share from my NAS (based on illumos aka OpenSolaris, I used the kernel CIFS) and now I installed Netatalk for better performances. The metadata apparently cannot be read back, that means ...
2
votes
2answers
101 views

How do I link/call an actual shell script saved within an Applescript app?

What's the correct syntax in the Applescript below to make this app run by double clicking on it rather than how it runs now by just running the Applescript in the AS script editor? The Shell script ...
1
vote
2answers
259 views

Applescript dictionary for Preview

Is there an Applescript dictionary for Preview.app? I am unable to find it under Mac OS X 10.7.5, and Applescript 2.2.1. I did a rudimentary search in google and duckduck but came up empty. I've ...
3
votes
1answer
579 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 ...
1
vote
0answers
55 views

How to prevent AppleScript confirmation from appearing when using Quicksilver trigger?

When I launch this simple AppleScript from Finder or by using the standard Quicksilver panel selection, it runs without confirmation. tell application "Flux" if it is running then quit ...
1
vote
1answer
102 views

Trying to remove files listed in file with AppleScript with do shell script call

The following code is an example of what I'm using at the moment, but it keeps erroring out on me: do shell script "find /Applications -name 'Bingo.app' > /tmp/remove_files" with administrator ...
1
vote
3answers
70 views

AppleScript variant of find(1)

How would I write the following as an AppleScript command without the use of bash scripting? find / -file foo.txt I might have the bash syntax wrong, but I want to search from the root of the drive ...
0
votes
1answer
58 views

How can I keep System Events from deactivating?

I'm using more and more Applescripts for home automation that rely on System Events being active. The problem is that System Events shuts down if it hasn't been used for a while. I'm not sure how ...
1
vote
2answers
225 views

AppleScript for moving completed downloads to other folders

I'm looking to write a script that will move all file in the downloads folder (once fully downloaded) to different folders on the hard drive and external hard drive. Where can I learn more about how ...
1
vote
2answers
102 views

Run applescript after specific application launch

VLC can't autoload extensions, so I write applescript to load extensions, now I need make run it every time after VLC start, any suggestions ?
0
votes
1answer
328 views

Printer Setup Utility gone in Mavericks, how to set default printer in Applescript now?

I have some Applescripts that set the default printer using "Printer Setup Utility", that seems gone in Mavericks. Anyone have an alternative to suggest?
4
votes
1answer
71 views

Automatic Window Switcher

I'm looking for a Mac app that will accomplish the following: Switch between two full-screen mac apps - Tweetdeck and iCal, automatically on a timed interval. Back and forth without stopping. We ...
2
votes
1answer
1k views

How do I give accessibility permission to my AppleScript and System Events in Mavericks?

I've got this old AppleScript that uses a mouseclick function: activate application "Safari" tell application "System Events" tell process "Safari" click at {424, 699} end tell end ...
1
vote
0answers
130 views

AppleScript : do a mouse scroll on a Finder window

How can I do a mouse scroll on a Finder window in AppleScript ? I know there is keystroke for the keyboard, click for a mouse click, but is there something for the mouse wheel ?
1
vote
2answers
106 views

Deleting files with applescript messes up Finder's CoverFlow

I wrote myself a little script to delete JPG+RAW files by just reviewing my JPG (who loads faster thant CR2). I've put the following code in an Automator service bound to a keyboard shortcut. on ...
0
votes
0answers
38 views

Applescript to move Calendar view of current week to top

Mavericks introduced a nice new feature in Calendar that puts a red bar above the current week while in the month view. You can also scroll by week, instead of by month, in the same view. With the ...
2
votes
2answers
473 views

Run script before restart/shutdown

Is it possible to execute a script/command right before OS X is shutting down or restarting? I'd like to run sudo apachectl stop to stop apache from auto-starting.
0
votes
1answer
283 views

Get Current Path to Script within AppleScript and Append Subdirectory

I have an AppleScript that I would like to be able to use from anywhere in the file system. Currently, it has some paths which are hardcoded, so it runs only from the Downloads folder. How should I ...
1
vote
2answers
630 views

User input assigned to variable in AppleScript then passed to “do shell script” command

How do I grab input from the user in AppleScript and then pass the result of the variable to a do shell script command from within AppleScript itself? For example, the user would type the answer foo ...
0
votes
1answer
438 views

AppleScript - “Close tabs to right of current tab” in Safari 7

I have been using the AppleScript below as an Automator service in order to get Safari to close all tabs to the right of the current tab. However I have updated to Mavericks (10.9) and find that this ...
5
votes
0answers
109 views

AppleScript to make the preview image become the master in Aperture library?

Recently I accidently deleted the folder that contained most of my Aperture library (I didn't think they were refenced, I assumed they were all in my library file, but unfortunately this was not true) ...
2
votes
1answer
451 views

Change the icon of an applescript-called notification

With OSX Mavericks we now can make notifications with applescript pretty easily. However, there doesn’t seem to be a way to change the icon that appears to a custom one. Is there a way to accomplish ...
2
votes
2answers
1k views

How to fast set hot corners in Mavericks?

I used a downloaded applescript to fast enable/disable hot corners but they don't work after I upgrade to Mavericks. Someone knows what's happening? Here's the disable script, hope it'll help you ...
2
votes
3answers
259 views

Applescript for deleting desktop files upon logout

I'm completely new to Applescript and currently very busy at work. I don't have time to learn it, I will once I find some free time, so I decided to ask you, the experts, for help. I need an ...
0
votes
0answers
52 views

How to style/format a string putting into Clipboard with Applescript?

How to style a string, which I want get copied into Clipboard, so I can paste it in the program's text window, which supports rich text? set the clipboard to myString as styled text doesn't work
0
votes
1answer
38 views

How to create a record at the runtime in applescript?

I would like to create a variable of type record at the runtime, I found this could work: set bcd to run script ("{" & "abc" & ":" & "def" & "}") But it doesn't: error "The ...
0
votes
1answer
40 views

Is there in AppleScript any way to use “X of every” to get multiple properties of each object to create a record?

It is possible to with the script: tell application "Safari" set urls to URL of every tab of every window end tell when execute, get all urls of every tab of every window (two dimensional list) ...
2
votes
1answer
185 views

Check for Existence of File then Move Rename Old File and Move New One

Here is what I am attempting to do: I have a folder which contains a script and a file. The file is an older copy of a file located in this path: ...
2
votes
4answers
578 views

osascript “set bounds of window” not working after Mavericks upgrade

I have a number of bash functions I run at the beginning of each day to start work. They all look pretty much like this: mind() { osascript -e 'tell app "Terminal" do script "ssh -A ...
0
votes
2answers
48 views

How do I save a screenshot with the ISO 8601 date format with Applescript?

I am building a script that saves many consecutive screenshots. I would like to save the files in the ISO 8601 date format.
8
votes
1answer
2k views

Any way to set/add tags on a file with Applescript under Mavericks?

Trying to move some of my scripts over from labels to tags under Mavericks, but I can't seem to find a way to set/add tags with Applescript. Anybody that know how to do this? As far as I can figure ...
1
vote
1answer
47 views

File path error in Applescript/TextExpander

I use the following code to open my dropbox folder quickly using textexpander. tell application "Finder" activate set f to POSIX file "/Users/MrT/Dropbox" open f end tell Which works, ...
0
votes
0answers
26 views

Is there a way to recognise active applications that are not being used so a script could shut them down?

Is there a way to recognise active applications that are not being used so a script could shut the down? I'd like to recognise an application that is running but has not accepted keystrokes recently ...
1
vote
2answers
288 views

How can I write an AppleScript which when run will connect to a specific WIFI network if available?

The title pretty much sums it up. I want to avoid having to use the trackpad to connect to certain networks. This comes up often when a new network becomes available but I'm already connected to ...
0
votes
0answers
91 views

How Can I Automatically Add Email Senders To Address Book

I would like to run a script that will automatically add email senders to my address book. I saw a post that answered this exact question, but I had a question about how to correctly deploy the ...
1
vote
0answers
117 views

Disable copy/paste for an OS X application

I would like to disable copy/paste for an app to protect sensitive information displayed in it. I don't have the app source code. I'm already aware of this general solution: ...
1
vote
1answer
35 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
86 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
0answers
52 views

Microsoft Word 2011 - Enforce All Documents read only mode

My use of Microsoft Word is often just reviewing documents - I often don't want to edit them, I mark my reviews separately (on our issue tracking tool). I know I can open a document in Microsoft Word ...
0
votes
1answer
308 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
102 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
270 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
343 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
221 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
203 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
222 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 ...