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
38 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 ...
2
votes
2answers
126 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 ...
0
votes
1answer
29 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"
1
vote
1answer
23 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 ...
1
vote
1answer
118 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 ...
0
votes
1answer
72 views

Help converting Apple Script to Shell Script

This Apple Script works great to mount the logged in Active Directory users network homedrive as a mounted network drive but we currently have it running as an App at login via "Login Items". ...
1
vote
1answer
74 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
0answers
14 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
25 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 ...
0
votes
1answer
79 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
1answer
76 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
2answers
121 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 ...
1
vote
1answer
201 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 ...
1
vote
1answer
113 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, ...
2
votes
2answers
2k views

How do I get Automator actions for Microsoft Powerpoint and Word?

I'm trying to set up Automator with a folder action to convert any Powerpoint or Word documents I drag into it to PDFs. I found this question: How do I script Powerpoint to save a directory of PPTX ...
1
vote
1answer
61 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 ...
1
vote
1answer
94 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" ...
0
votes
0answers
93 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 ...
3
votes
3answers
244 views

Can Safari's download popover window be made wider?

How can the max. width (fixed width≈425) of Safari's download-popover-window be made wider? Is there a way to get at Safari's "download pop over window" in any way so its max-size is larger than 425 ...
0
votes
0answers
42 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
261 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
131 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
117 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 ...
2
votes
1answer
148 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 ...
0
votes
0answers
26 views

Why is the 'on open' handler running twice per invocation of my droplet?

I am experiencing an issue in my 'on open' handler in a droplet. It actually gets called twice for certain combinations of files, like it's trying to process them in parallel. on open weblocs ...
0
votes
1answer
103 views

Adding Line Break to Email Body Content of Mail.app Message Generated in AppleScript

I'm currently using the below script to send out an email with a specified subject, attachment, and body message: on run argv set theSubject to (item 1 of argv) set theAttachmentFile to (item ...
1
vote
0answers
18 views

Automating VPN switching

I can us a VPN app like tunnelbear to appear to be in other countries, but is there a way to do this in a bash script or applescript? I want to be able to run automated tests on my iOS apps (in the ...
1
vote
2answers
68 views

How to change “Nov 9 03:21:11” to yymmdd mmhhss using AppleScript/Unix?

How to change string "Nov 9 03:21:11" to yymmdd mmhhss in AppleScript?
1
vote
0answers
36 views

AppleScript, Mail, & Outgoing Message Visibility

Here's a simple AppleScript for creating and sending messages. tell application id "com.apple.mail" repeat with i from 1 to 5 set newMessage to make new outgoing message at ¬ ...
2
votes
1answer
77 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 ...
2
votes
2answers
565 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 ...
2
votes
1answer
27 views

Launch different apps based on file name (other than the extension)?

I'd like to have different apps handle .jpg files based on a naming convention I'll use for the .jpg files. Specifically most will go to Xee, but ones containing thumb should instead cause VLC to be ...
1
vote
0answers
71 views

Copying a path of the app to a new directory?

I was wondering if someone could help me make an AppleScript that copies the app the script is into another location. So, this is what I tried... (Please don't say anything since I am new at ...
1
vote
2answers
335 views

Batch download URLs from a .txt file

I have a .txt file with URL's on a separate line. http://www.apple.com http://www.google.com http://www.reuters.com I would like to download these webpages as a page source (a .html file) so I can ...
0
votes
0answers
29 views

How forward email attachment as new email?

Each day an email is received from a specific sender with a pdf. That pdf then is to be sent as a new email with no history of the previous sender. Any ideas how to do this?
1
vote
1answer
170 views

Controlling audio output's sample/bit rate on OSX from command prompt

Is there a way to limit the output format of a soundcard on OSX, apart from Audio MIDI Setup? I have noticed that OSX has a bad habit of resampling audio while it is not needed at all (say the output ...
1
vote
2answers
963 views

Why AppleScript in El Capitan runs differently?

Why in El Capitan this app says 3 1 2? Before El Capitan it said 1 2 3. When this script is double clicked, it needs to say 1 2 3. on run say "1" testing() end run on testing() say "2" end ...
0
votes
0answers
95 views

Import .ics files programmatically

If I have one or several .ics files, how is it possible to add them to a particular calendar without me using the Calendar app directly? The Applescript library for Calendar doesn't list an import ...
0
votes
0answers
185 views

AppleScript & Notes App

Is it possible to use AppleScript to change the font in the Notes App? I am not very familiar with AppleScript, so I may have missed something, but my attempts to change the font have failed. The ...
0
votes
1answer
47 views

Applescript Access Variables Through Run Script

Let's say I have a script: set hi to 7 run script "display dialog hi" When I run it, it says that hi is undefined. Is there a way to make hi accessible from the run script command? If not, what ...
2
votes
1answer
55 views

Change Copy and Paste behaviour system-wide

I would like to enhance the global copy/paste behaviour with an additional action. In particular, I often use Growl to display custom notifications. From the command line, I can use the growlnotify ...
1
vote
2answers
847 views

Any way to change sound output device via Applescript or shell?

I would like to change sound output device (like option-clicking the speaker icon in the menubar) via script, but NOT through UI scripting, e.g., launching the System Pref panel. UPDATE: Using ...
0
votes
1answer
94 views

Delete Keystroke from AppleScript

Context In Safari, there is a text field, in which, contains name of an image with extension .png, and I have to remove that extension. Solution Write a script, in which, simulate Delete(⌫) key 4 ...
0
votes
0answers
36 views

Applescript unable to get the participants for every chat

I'm trying to access the chat participants for every chat in Messages. Currently my script is this: tell application "Messages" to get participants of every chat However, the result is a missing ...
0
votes
0answers
85 views

Finder can't handle objects of this class

I am following the instructions on this website Optimize CS:GO... trying to run this script in AppleScript Editor. set myfilepath to "Users:MYUSERNAME:Desktop:Counter-Strike Global Offensive.app" ...
0
votes
1answer
44 views

Mail Script that moves messages with download links to a folder

I am a music supervisor and I receive lots of emails with links to download new music. I'd like to sort these into their own folder automatically. Is there anyway to sort emails that have links to ...
0
votes
0answers
10 views

Applescript message when Remote Desktop connection established [duplicate]

I am trying to create an applescript that will send a message to me when a computer is being remotely viewed. I have this so far: tell application "Messages" to send "Boo!!" to buddy "Number" of ...
0
votes
1answer
46 views

I need an application to read aloud any emails that come into a specific email address

I want a sort of audio server which sits in background (running on OS X, not iOS) and whenever an email arrives at a specific address, it reads it aloud. Ideally there would be also an option to ...
0
votes
1answer
106 views

Need script to automatically export Skim PDFs with embedded notes

I have a folder with a few thousand PDF files, most of which have Skim annotations (e.g., highlights and notes). If I had fewer files, I'd just go through each one, export the PDF with embedded notes, ...