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
0answers
17 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
63 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
25 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
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 ...
2
votes
2answers
309 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
26 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
58 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
144 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
22 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
109 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
556 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
59 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
125 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
39 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
50 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
278 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
47 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
27 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
46 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
35 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
40 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
77 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, ...
2
votes
1answer
30 views

Copy BPM & Star rating to Comments in itunes using Applescript

I want an applescript to grab the BPM & Star Rating of a selected group of MP3's and paste the info into the comments section. I found this code that will copy the star rating one track at a ...
0
votes
1answer
62 views

Applescript: How to move a file after finishing processing it?

I'm very new to writing applescript, but have been painfully working through it. I have successfully written scripts to download specific csv attachments from an email inbox, then create an SQL ...
1
vote
2answers
47 views

Copy a file's NSURL to clipboard

I am trying to do a rather simple thing: in the context menu I want to have an action (e.g. with Automator) that gets and copies the file's NSURL to clipboard. The solution seems simple, but it does ...
0
votes
1answer
133 views

Using AppleScript to Send Email from Mail.app to Multiple Addresses

I am able to successfully send out an email with an attachment to a single email address using the code below: on run argv set theSubject to (item 1 of argv) set theAttachmentFile to (item 2 ...
0
votes
2answers
172 views

Applescript: Automatically check and remount server volume stopped working

Yesterday, I found a script that makes my Mac (MacBook Pro running El Capitan) automatically check for a volume on a server and remount it if the connection drops. I adapted it slightly to this, so my ...
1
vote
0answers
365 views

Error executing AppleScript through Launchd - “Service could not initialize”

I've written an AppleScript that turns our CenturyLink modem's wireless radio on or off. It works when I run it manually with osascript, but now I'm trying to get it set up on a schedule with Launchd. ...
1
vote
0answers
45 views

How to get text from Facebook webpages using Automator?

I am managing a network on Facebook that has about 3 million subscribers in about 500+ groups... I used to extract text from those Facebook Group pages using Automator, after getting a huge text file ...
2
votes
2answers
484 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 ...
0
votes
0answers
77 views

Only copy files modified after certain date, and maintain file structure

So, I had to do some work on a drive that's used where I work. It's an important drive, and couldn't be down while I did this, so I copied the files to a new drive for use while the other was ...
0
votes
0answers
17 views

Possible to create a hyperlink to a specific contact in Contacts.app or specific event in Calendar.app?

Is there a way to create a link/hyperlink to a specific contact in Contacts.app or a specific event in Calendar.app? I'm thinking of something along the lines of a contact://contact-guid or ...
2
votes
1answer
62 views

Remove folder name from file name based on existing Apple Script

so I have this apple script here that I used to insert the folder name into the front of all the files in the folder. The script is able to run through every single folder and target all the files and ...
0
votes
2answers
799 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?
5
votes
1answer
531 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 ...
1
vote
1answer
56 views

Is it possible to read the accessibilityLabel attribute of an item using AppleScript?

I'm trying to extract the list of cookies according to Safari. I have the following code fragment: tell application "Safari" to activate tell application "System Events" to tell process "Safari" ...
1
vote
1answer
26 views

Applescript to check for the existence of a file

I record radio programs during the night and then run an applescript to rename the files. I have the script working unless there is no file named that I am attempting to call and rename. Here is my ...
0
votes
0answers
47 views

Apple Script to Send Message to Most Recent “Messages” Conversation

Starting with the following line: set _message_ to "Example message" I am looking for a way to send _message_ to my most recent conversation in Messages. This means the conversation I most recently ...
0
votes
3answers
145 views

Applescript Won't Invoke Shortcut Command

I have a long TextEdit document I frequently open (via a keystroke, thanks to Alfred). It contains many non-standard spellings, so I de-select "Check Spelling While Typing" (though I want spell ...
1
vote
1answer
157 views

Automating numbers, Exporting the file as an excel document

I have recently acquired a Macbook Pro (OS X Yosemite 10.10.4). I find the Numbers application satisfactory to work with, but I save the file as an .xlsx file after I am done. I need to make changes ...
4
votes
1answer
59 views

Write an AppleScript to create a web link on the desktop

I'm helping a visually impaired friend learn how to use her Mac. She's using the built-in screen magnifier, which is working great. She likes to access websites (mainly TV streaming services) via ...
0
votes
1answer
110 views

Applescript to move focus to active or next window

I am trying to implement a "Command-tab" style setup that works only within a specific space. For most apps, "Ctrl-F4" which is "move focus to active or next window" works correctly, but for ...
1
vote
0answers
45 views

How to make an AppleScript that edits the next note in Mac Notes

I want a shortcut to edit the next note in Mac Notes. Since there is no menu alternative for this I guess I need to create an AppleScript for it. I've tried to use the Notes library in the AppleScript ...
0
votes
0answers
32 views

Terminal: executing a batch of commands from dynamic locations

I'm trying to restructure a library of audio files and I've been trying to do so using Terminal. See the folder structure in the attached image. There's a couple of things I want to do: 1) Remove ...
0
votes
1answer
106 views

How to get the window id with title of every process?

I'm using the following simple script: tell application "System Events" to get the title of every window of every process Which works by printing titles of every window. tell application "System ...
0
votes
1answer
152 views

Drag to convert Automator Action into Applescript

In Automator, there is a way to quickly convert an Action into its equivalent Applescript in Automator, I think by dragging it in some tricky way. I saw this some time ago but have now forgotten. ...
0
votes
0answers
27 views

AppleScript runs twice?

This script should say a b just once but many times it says a b a b. I think this has something to do with Saved application stage. I emptied Saved application stage folder for this script then ...
0
votes
2answers
100 views

Selecting Random File in AppleScript

I’m trying to make a script that can select/display/open a file randomly from a folder and its subfolders. The following script: tell application "Finder" get some file of (folder ...
1
vote
0answers
55 views

how to capture screen excluding a window with screencapture?

The command line utility screencapture can capture the desktop and a specific window with the commands screencapture Desktop.png and screencapture -l$(osascript -e 'tell app "Safari" to id of window ...