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

learn more… | top users | synonyms (2)

1
vote
1answer
41 views

Getting the lower variable

In applescript I have 4 variables, each one with its number. I'd like to have a function that tells me which variable is set to the lower number. EG. set one to 12 set two to 55 set three to 2 set ...
2
votes
3answers
124 views

Create hotkey to insert text

I want to create a hotkey command that insert this text "/" in whatever application I'am The reason is because I'm a developer and I use the / symbol a lot, the problem is with my keyboard layout, ...
0
votes
1answer
87 views

Windows positioning with applescript

I want to set the position of some windows to certain coordinates. In particular I have 4 possible positions that those windows should have. For example if I have 4 windows opened I want them to go ...
1
vote
2answers
109 views

Escaped path in AppleScript adds leading /

I have the following AppleScript that I am trying to debug: tell application "System Events" set theResult to (do shell script "sqlite3 ~/Library/Application\\ Support/Dock/desktoppicture.db ...
0
votes
0answers
113 views

Applescript to enable internet sharing, but select where to share the connection from

I have the following applescript code that turns on internet sharing. What I want to be able to do is also have the applescript choose which connection I am sharing from the dropdown menu list. 1 ...
1
vote
1answer
62 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 ...
2
votes
1answer
40 views

Best way to distribute script with low friction

I have helped a few friends recently with fixing a problem on OS X and I would like to turn it in to a script so I can send it to people instead of walking them through it. It consists of two steps: ...
0
votes
1answer
1k views

How to create applescripts for Outlook 2011 to replicate Quicksteps?

Outlook 2010+ for PCs includes Quickstep functionality, that allows you to create multistep rules or macros to easily perform actions on selected email(s). Examples are automatically categorize an ...
1
vote
1answer
298 views

Applescript enable-disable wifi Safari

I figured out a command to enable/disable wifi. networksetup -setairportpower en0 on networksetup -setairportpower en0 off Now, I was wondering how to combine it in AppleScript in a way that when ...
2
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 ...
0
votes
0answers
38 views

Applescript to change main monitor

Is it possible to record some actions for figuring out the right applescript? I'm looking for applescript to toggle my computer from screencast settings to regular: Regular: 1. Display Time. 2. Main ...
3
votes
1answer
100 views

AppleScript Editor : comment line shortcut?

Is there a keyboard shortcut to comment lines in AppleScript Editor ? The common Cmd+shift+/ does not work here.
0
votes
1answer
348 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
708 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
126 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
143 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
134 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
120 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
503 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
955 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
71 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
131 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
138 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
81 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
295 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
150 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
446 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
74 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 ...
2
votes
0answers
180 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
112 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
59 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
759 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
955 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
1k 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
639 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
1answer
149 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
820 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
3answers
2k 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
461 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
85 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
46 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
69 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
260 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
941 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
61 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
73 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
30 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
343 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 ...