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

learn more… | top users | synonyms (3)

5
votes
0answers
52 views

count of desktops only returns 1

Any idea why the following script would only return 1, when I clearly have more than one Desktop open? tell application "System Events" set n to count of desktops display alert n end tell I ...
4
votes
0answers
455 views

Create Custom Drop Down Menus in the Finder Toolbar

Happy (belated-ish) new year! Hope it's been a great one. Any Dropbox users out there will recognize the drop down menu that one can add to their Finder toolbar. Upon discovering that this existed,...
4
votes
0answers
391 views

Is it possible to compose Mac OS Mail in an external editor?

For Thunderbird there is the External Editor extension a very very classical piece of software that, when called via a shortcut, pops up your external editor (emacs in my case) and let's you edit your ...
3
votes
0answers
94 views

Tmux hampers osascripts display notification

I like to show notifications from scripts using osascript -e 'display notification "Some text"'. This works fine from the plain shell but it stop working when in tmux. It just doesn't show the ...
3
votes
0answers
341 views

Applescript vs. Spaces in Lion (10.7)

In Snow Leopard (10.6), I had an applescript that toggled iTunes between "maximised on Space 2" and "mini-player on all spaces": set app_identifier to do shell script "echo 'com.apple.iTunes' | /usr/...
2
votes
0answers
44 views

Close Dock and top bar

Is there a way to keep the application Dock closed. Every time I do: killall dock It closes for a bit then automatically reopens. I want to be able to make an AppleScript program that keeps it ...
2
votes
0answers
19 views

How to fix «event coreslct» error?

I have an AppleScript source with this code: tell "Microsoft Word" «event coreslct» (last row of table X of document Y) insert rows selection position below number of rows Z end tell After ...
2
votes
0answers
42 views

Getting all windows returns inaccurate items

I noticed when getting all windows that there are extra window items returned than there are. For example for Safari, it returns 9 windows but there are only 3 windows open; all the others are ...
2
votes
0answers
41 views

Applescript Printer Alerts via iMessage

Is there a way to send an SMS via Applescript/Automator in either of these scenarios: When a low printer ink alert occurs ("Cyan is at or below 10%) With the periodic status of ink levels ("Cyan=10%,...
2
votes
0answers
365 views

Yosemite Mail “Load Remote Content” from senders in my contacts

I would like Mail on Yosemite to load remote content from senders in my contacts and not for everyone else. I have remote content disabled now and I have pieced together an AppleScript to click the ...
2
votes
0answers
129 views

Is there a tool or scripting approach to change the arrangement of displays?

I move my monitors around a bit during the day. Specifically I rotate them or move my laptop to different positions. Each time I have to open up System Preferences > Displays > Arrangement and make ...
2
votes
0answers
557 views

batch convert iWork 08 files to new version on Yosemite

TL;DR Short version: I have a bunch of files that were created with iWork 08. Is there a way, maybe using AppleScript or Automator, to convert them to the new format (Pages 5.5, Numbers 3.5) without ...
2
votes
0answers
63 views

How do I make an applescript launch as soon as it exits screen saver

I would like my mac to to say 'Login Authorized' as soon as I exit screen saver mode. Where should I place the script? Thank you in advance!
2
votes
0answers
356 views

Tell application “Microsoft Outlook” not working after Yosemite upgrade

I have two Macs. The AppleScript code below runs on one Mac ("Mac 1"), but not on the other ("Mac 2"). Mac 1 is running Snow Leopard, where Mac 2 was upgraded to Yosemite, and the AppleScript below ...
2
votes
0answers
109 views

Export image from clipboard to folder

I create a lot of mockups for my mobile phone. I recently heard of the brilliant idea to just put your current mockup as an image into your Dropbox (or whatever cloud your using). Then just take your ...
2
votes
0answers
638 views

AppleScript to read all notifications in the Notification Center OSX 10.10 Yosemite

It seems like the following AppleScript is no longer working in the latest version of the OS X 10.10 (Yosemite): on run tell application "System Events" tell process "Notification Center" ...
2
votes
0answers
151 views

How to set positioning/filling of desktop background image with AppleScript

How can I set the positioning/filling of the desktop background image from the command line with one of the available options listed in the Desktop & Screen Saver preferences: Crop, SizeToFit, ...
2
votes
0answers
43 views

Applescript Editor's compiler erratic behaviour

I've just come across some bizarre behaviour in the Applescript Editor (Snow Leopard - 10.6.8) that I was wondering if anyone knows how to get around it. Basically, one second a statement will ...
2
votes
0answers
240 views

How can I start a Hangouts phone call with Applescript/Terminal?

I want to initiate a Google Hangouts phone call with Applescript. Hangouts has an AS dictionary, but with only the default suites. I want to emulate opening the Hangouts popup, typing in a phone ...
2
votes
0answers
327 views

AppleScript for enabling VPN broken after update to 10.9.3

I've been using an AppleScript for connecting to my office VPN. After updating my macbook to 10.9.3, it fails to execute, and throws an exception Unable to get network preferences (honestly, it is ...
2
votes
0answers
340 views

Get iTerm session by tty name

I want to run a command within an iTerm2 session like this: tell application "iTerm" tell session id "/dev/ttys020" exec command "ls" end end But I get the following error (with and without ...
2
votes
0answers
82 views

Run rake using Automator

I have install ruby using RVM. Next I create workflow in Automator, which detects new files in folder and then copies them to another dir. The next thing I want - to switch to those folder and run few ...
2
votes
0answers
397 views

Detecting typing in Messeges app using applescript?

In the new Messages app, which replaced iChat, you can see when another person is typing: And i've been scripting around the messages app and was wondering if there was any way to detect when the ...
2
votes
0answers
58 views

Sort Stickies by desktop

I have OS X Lion 10.7.5 with four desktops and also have 4 groups of stickies (one group per desktop). Every time that I have to reopen the Stickies app, they are unsorted (all stickies open on the ...
2
votes
0answers
495 views

AppleScript to find old mail messages is slow in ScriptEditor

So I have an AppleScript that iterates over all the messages in various mailboxes and finds messages which meet various criteria and moves them to Deleted Items. The mailboxes in question are ...
2
votes
0answers
144 views

AppleScript deployment conventions?

I haven't seen a package-management system for AppleScripts, but it seems like the foundations for one are present. Given: Scripts (and folder) located in the ~/Library/Scripts/Applications folder ...
2
votes
0answers
725 views

With Lion, Problems Accessing Shared NTFS Folders with SMB://

We are testing a local login script that we created for our Macintosh users on Lion. It has worked fine on all OS X versions prior to 10.7. Listed below is the script that we are using. When we run ...
1
vote
0answers
27 views

'Add notes' to a Calendar event using Automator

I would like to build a 'Service' for selected text which: Get the currently selected text Creates an Calendar event adds the selected text as a 'note' for that Calendar event I prefer Automator ...
1
vote
0answers
41 views

The process of making custom notifications, iOS GarageBand, iTunes database, iTunes file format, AppleScript

I'm developing an iOS and Android app which uses custom notification sounds to provide users with step-by-step instructions. I've recently stepped through a pretty messy process of creating these ...
1
vote
0answers
183 views

Curl terminal command syntax from Applescript

I want to execute a curl command in Applescript that does the following (per this SE question/answer): http://superuser.com/a/1054803/471181 ...Do an HTTP POST of the contents (as a string) of a ...
1
vote
0answers
31 views

Why would a codesigned app suddenly start triggering “… not allowed assistive access.” error?

Environment: OS X 10.10.5 Background: I have an applescript I've been using for past year or so. I use it for copying a password from my password manager (1Password, in my case), and it then pastes ...
1
vote
0answers
25 views

Change Notification Style from Banner to Alert via AppleScript

does anybody know an easy way to make an apple script that changes the notification style for a specific app from "banners" to "alerts"? I've been trying for hours but I'm finding it hard to use the ...
1
vote
0answers
37 views

How to get the fps of a video from QuickTime Player's inspector using applescript

I need a quick and easy way to find the frame rate of a video in applescript. So far grabbing it through QuickTime Player's inspector seems like the easiest option. tell application "QuickTime Player"...
1
vote
0answers
40 views

trim Mac files to move to Windows

I have a large number of Mac files that I need to remove illegal characters that Windows will not like and to shorten the file names while preserving the extension. I have found a Bash script that ...
1
vote
0answers
19 views

Error when I try to put my computer to sleep

I'm trying to use this script: on run delay 5 set lidState to do shell script "ioreg -r -k AppleClamshellState | awk -F \" = \" '/AppleClamshellState/ {print $2}'" if lidState = "Yes" ...
1
vote
0answers
66 views

Save pdf from sender in Mail.app to folder with applescript

Trying to find out how to save email attachments like a pdf to a folder and can't figure out what I'm missing using the following. Any ideas? using terms from application "Mail" on perform mail ...
1
vote
0answers
40 views

AD network drives and or apple script editor

I have a new Mac laptop. I have it on a Windows domain and I get my drive mapping in the sidebar when I login with my AD account. When I change my account to a mobile account I loose the mapping in ...
1
vote
0answers
39 views

How to detect number of lines in AppleScript

I want to use TextWrangler as an R-editor. To make usage more handy I found a script online by Jean Thiolouse which I edited slightly: tell application "TextWrangler" set the_selection to (...
1
vote
0answers
34 views

How can I use turn on/off application in AppleScript?

Can I use to turn on/off application by 'keyboard' in AppleScript? I make simple macro program, for example auto mouse click or keyboard. But if idle start, I can't pause or stop it. So I need ...
1
vote
0answers
172 views

AppleScript to automatically update IP-adress in Remote Desktop (ARD) on computers with DDNS

I've been searching for hours but couldn't find an answer yet hence my question here. I frequently use Apple Remote Desktop (ARD) and I have setup a DDNS for every computer. The only problem I have ...
1
vote
0answers
29 views

Manage Finder favourites with defaults write or similar?

I've been unable to find any preferences list file with the locations for the 'Favorites' list shown in the Finder sidebar. No luck from likely candidates com.apple.finder and com.apple.sidebarlists. ...
1
vote
0answers
13 views

Find Contacts by address type

I just mass-added and edited about 500 contacts from my archives, and I would like to set the address type for some of them from other to home. I'd like to search by address type for all contacts ...
1
vote
0answers
161 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
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
0answers
39 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 ¬ ...
1
vote
0answers
75 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
0answers
749 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
62 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 ...
1
vote
0answers
48 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 ...
1
vote
0answers
65 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 1'...