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
27 views

How can I get the window bounds for “Adobe Illustrator” in AppleScript?

Apparently, Adobe doesn't have a single mechanism in place for people using a laptop and additional monitors with their products. As an Adobe CC user who primarily works from a laptop that connects to ...
1
vote
1answer
51 views

Toggle Show Date and Time via AppleScript

How can I toggle the "Show date and time in menu bar" option via AppleScript. I'm using OSX 10.10.4. I am looking for a working example in AppleScript.
0
votes
1answer
68 views

List all programs without any window and kill them

has anyone an idea for an AppleScript that checks the number of windows of all applications and kills programs with window count 0? Thanks a lot!
2
votes
1answer
244 views

How to set Photoshop CC window size to 1280x720 via AppleScript?

I'm trying to resize the Photosshop CC window to 1280x720 to record it in 720p. I tried multiple ways, including AppleScript, SizeUP! app, terminal etc but none work. Here's an example of AppleScript ...
0
votes
1answer
38 views

set position {0,0} of element accessibillityTitle via Applescript

I have a UI element called accessibillityTitle with value Layers and I want to position this element in the top right corner, but I don't know how to acces it via Applescript. I have found the element ...
7
votes
1answer
638 views

Is it possible to disable Safari extensions when using Private browsing?

I recently switched from Chrome to Safari for a few choice web applications, and I found that I couldn't disable extensions like Lastpass when browsing privately, at least not apparently, like I could ...
0
votes
1answer
29 views

Applescript toggle to do This, this time, and That, next time?

Let's say I have an Applescript that does THISCODE. And I have another Applescript that does THATCODE. I always run them in sequence, but never at regular intervals. In other words, whichever one I ...
0
votes
2answers
117 views

How to check if invisible items are visible?

How do I check in AppleScript, if invisible objects are visible? If visible, do: defaults write com.apple.finder AppleShowAllFiles 0 in invisible, do: defaults write com.apple.finder AppleShowAllFiles ...
1
vote
1answer
21 views

Is it possible to modify the behavior of Finder UI elements with AppleScript?

I wrote an AppleScript that scans my entire iTunes library and tags those files with their Genre (so I can easily access them in Finder by just clicking the right tag). The next step on my list would ...
0
votes
3answers
86 views

How to use Applescript to find duplicate files and .mp3 files in my iTunes “Music” folder and subfolders?

I recently moved my iTunes music library onto a new computer set-up by copying the "iTunes Media" folder onto an external HD and then onto my local disk. When I opened iTunes for the first time, it ...
2
votes
2answers
85 views

Wrapping youtube-dl into automator via applescript

I am hoping to make an automator application that prompts the user for input (i.e. youtube url), and downloads it using youtube-dl (already installed via Homebrew). After this, I am trying to use the ...
0
votes
0answers
37 views

Trigger an action when a specific video file plays? (VLC)

Objective: I have a VLC playlist. Whenever a new video begins, I'd want it to trigger my Philips Hue lamps to change lighting settings. The lighting settings are pre-made, with specific names, and ...
2
votes
2answers
90 views

Automator service script ALWAYS launches application, disregarding conditional

I wrote a little service script to open an iTerm terminal window on an arbitrary folder on Finder. I want it to check if iTerm is running, and if it is to open the terminal session in a new tab ...
1
vote
1answer
84 views

Applescript for specific System Preferences pane

I'm trying to write an applescript to get me to a specific section of the system preferences - Keyboard > Shortcuts > Services and hopefully to a specific service as well. I've gotten a part of the ...
0
votes
0answers
27 views

Interact WITH a running Applescript script/program without leaving the current program (Hotkey, sent keystroke etc)

(I asked this on Stacksoverflow before discovering this Apple specific sub-forum. I hope cross posting is accepted when done in a more relevant forum) The general question from my specific problem is ...
7
votes
7answers
6k views

AppleScript “delay” command not working since switch to Yosemite

Note: The issue with delay was fixed in OS X 10.11 El Capitan. Ever since I upgraded to Yosemite, Applescripts that use delays have stopped working. How can I fix this? Here's the world's simplest ...
1
vote
0answers
73 views

Script to start my VPN if I'm connected to a specific Network / SSID [El Capitan update]

I'm searching an AppleScript to automatically start my University VPN if I'm connected to the University network. I already found some solutions for older OS X Versions, but they're not working ...
1
vote
2answers
77 views

Applescript - how can I select all *non*-folders in an expanded list view window?

I am trying to write a script which will select all non-folders in a given Finder window which is in List View and has revealed/expanded all sub-folders (see image). As there tend to be many more ...
0
votes
0answers
31 views

Look Up - AppleScript command

Is there an apple script command for the "Look Up" action/service? If not, what would be a decent way to mimic it? If you don't know what I'm talking about it's the popover when you three-finger ...
0
votes
1answer
178 views

AppleEvent Handler failed (-10000)

I'm having issues with a simple part of script, where I wanna get the property dock preferences of System Events. I have the following: tell application "System Events" tell appearance ...
0
votes
1answer
57 views

Process not running but app shown in dock

I have an applescript that runs automatically and relies on the application "Contacts" to be running. Occasionally, it fails when the "Contacts" process mysteriously disappears from the activity ...
1
vote
2answers
3k views

Why does my Automator service work in Automator but not when called from the OS?

I have made an Automator service that runs an Applescript with the Run Applescript module. This is the script: # Press ^F8 tell application "System Events" key code 100 using control down end ...
0
votes
0answers
23 views

AppleScript - extract a string of characters from similar filenames and group into a folder with that string as the name

I have a folder full of files like this: SA-2A05_3.psd SA-2A05_4.psd SA-2A05_5.psd SA-2A05_6.psd SA-2A05.psd SA-2A06_3.psd SA-2A06_4.psd SA-2A06_5.psd SA-2A06_6.psd SA-2A06.psd and I want to create ...
2
votes
1answer
57 views

Different results of running the same AppleScript

The script is: tell application "DEVONthink Pro" activate end tell tell application "System Events" tell process "DEVONthink Pro Office" tell menu bar 1 tell menu bar ...
2
votes
2answers
73 views

Make an XML iTunes Library working in a NAS server

I recently bought a QNAP NAS (TS-251) and everything is working fine. I'm now on the iTunes part of my setup and here is my tricky situation. I have a personal library I'm backuping that I would like ...
1
vote
2answers
78 views

Apple Script notification bubble - quick reply style prompt

I know that you can trigger a notification using Apple Script: osascript -e 'display notification "Hello" with title "How are you feeling?"' However, I also want to be able to prompt for certain ...
2
votes
2answers
71 views

Using Apple Script to Manage Sound Output Selection

I am brand new here and I have an additional clarification or need additional help for an issue from this thread - Applescript: "can't get tab group 1 of window" (El Capitan) In my ...
0
votes
1answer
25 views

Using the option key in Apple Script.

I am working on a script that puts in strings of text into a document, and I was wondering how you would have apple script input the keystroke "Option-Return"
2
votes
2answers
3k views

Access application submenus with AppleScript

I am trying to learn to access any menu item within an application with AppleScript. I can orient to the actual menu tab, and then access clickable menu items, but I can't access menu items within ...
1
vote
1answer
66 views

AppleScript “can't get menu item” error

I am looking for some help on correcting this error: error "System Events got an error: Can’t get menu item \"Clear History...\" of menu \"Safari\" of menu bar 1 of process \"Safari\"." number ...
2
votes
2answers
485 views

Booklet creation El Capitan

Since I passed to El Capitan, good'ol Create Booklet 1.2 (http://www.macupdate.com/app/mac/21068/create-booklet) won't work anymore (it used to be free, but is now paid for). All the available booklet ...
2
votes
4answers
1k views

How to add a Safari toolbar button that runs an AppleScript

How do I add a button to the Safari toolbar that, when clicked, executes a given AppleScript?
1
vote
1answer
43 views

AppleScript editor to connect and disconnect again to specific server

I's trying to write an AppleScript to disconnect and connect again to specific server: tell application "Finder" mount volume "smb://serveraddress/sharename" as user name "username" with ...
0
votes
2answers
804 views

How to archive mail in Outlook 2016 with a shortcut?

Outlook 2016 has removed support for AppleScript. I used to use a script to move my mail to the Archive folder on Ctrl-A. How do I restore that functionality?
1
vote
5answers
11k views

How can I create a stand alone APP to run a terminal command

I have the requirement to manually run the OSX maintenance scripts in OSX (Lion / Mountain Lion). I would like to create a completely stand alone application that would achieve the following goals: ...
0
votes
0answers
13 views

How can I import a text file of emails into Mail?

I have thousands of emails from the nineties that were exported as a text file that I'd like to import into Mail. I'm looking for a way to do that directly or indirectly. I'm assuming it will require ...
1
vote
1answer
24 views

Click a tab item in system settings using AppleScript in Automator?

I'm trying to create a shortcut to start system preferences and open the sound settings in the "in" tab. So far I have started system preferences and opend up the audio settings, maybe not in the ...
1
vote
1answer
42 views

How do I set a textfields string to a variable in AppleScript?

I want to set the text in a text field to a variable, in this case called variable1. Here's the part of my script. on button836_(sender) set variable1 to quoted form of POSIX path of (choose ...
2
votes
1answer
75 views

Why does this Applescript for talking to iTunes fail with timeout for some customers

This script works okay for me and most of my customers, but for a few customers it times out with error -1712, Ive no idea why. Ive tried increasing timeout it makes no difference. The file ...
1
vote
1answer
68 views

What are the variables needed to access focus properties in split screen view?

What are the names of the variables (in terms of Applescript variables or otherwise) that track the currently focused application, the layout of applications in spaces, the currently focused space, ...
1
vote
1answer
65 views

Applescript - Getting Property of an Object Not Working

The dictionary for Messages states that the application has a "chat" element which has the property "updated". My goal is to get this property, and here is my code: tell application "Messages" ...
1
vote
1answer
42 views

Adjusting screen brightness based on application

Is there a way to trigger some apple script based on applications/events? What I want to do is to increase brightness when I am running videos etc. fullscreen, and reduce it when I exit the ...
5
votes
1answer
533 views

Applescript: “can't get tab group 1 of window” (El Capitan)

The following is an applescript that I use to change audio output devices: tell application "System Preferences" activate set current pane to pane "com.apple.preference.sound" end tell tell ...
0
votes
0answers
47 views

AppleScript to find currently open Gmail tab and Compose new email

I'm trying to modify the following script to compose a new email in an open Gmail tab: https://github.com/mobjack/MacChromeCalendarFocus This simple script finds the Chrome tab with Google ...
0
votes
0answers
21 views

Specify an OpenVPN connection name for Tunnelblick using AppleScript

I'm attempting to use AppleScript to tell Tunnelblick to start a VPN session: tell application "Tunnelblick" disconnect all log state connect "Torguard.United.Kingdom" log state ...
0
votes
0answers
14 views

Delete / archive mail with similar title on arrival of specific title

I'm a programmer and for every ticket/issue/bug I get an email. Now I would like to automate some of the tasks relating to those emails. I already set up subfolders and mail rules to keep me from ...
0
votes
0answers
153 views

Unmute audio input (microphone) in OSX programatically

OSX 10.10.3, also reproducible on 10.8, doesn't seem to happen on 10.11 Reproduction steps Go to System preferences > Audio > Input Set input volume to 0 (this is important) Run this script in ...
2
votes
1answer
116 views

Execute arbitrary script when iTunes plays new song?

I want to execute a script when iTunes plays a new song. I have looked at Automator as well as the iTunes Library in Script Editor, but don't see anything that will allow me to do this. Any ideas?
2
votes
2answers
310 views

Applescript: Automate Excel to convert .xls to .csv

I'm trying to batch process converting a folder of .xls files to .csv using Applescript for MS Excel V15.15. I'm using a sample I found online to model it : set theOutputPath to (path to desktop ...
1
vote
1answer
74 views

Why am I getting “Error -1,752” when trying to save in Script Editor?

I'm trying to edit a script in ~/Library/Scripts/Applications/Mail. When I attempt to save from Script Editor I get The document "Reply.scpt" could not be saved. (Error -1,752). It doesn't seem to be ...