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

learn more… | top users | synonyms (3)

4
votes
0answers
340 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
55 views

Can't Set Desktop Background in Fullscreen App

I have an 11" Air so I usually run all of my open applications in fullscreen mode. I have a launchd job for my user that runs a script every hour and every login to set the desktop background ...
3
votes
0answers
356 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 ...
3
votes
0answers
92 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
336 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' | ...
2
votes
0answers
327 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
533 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
53 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
279 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
93 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
503 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
41 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
299 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
79 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
365 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
52 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
457 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
138 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
720 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
29 views

How to ensure that windows opened from the Dock open in the current Space/Desktop

A Mail window was in the Dock, and I clicked on it to restore it to my current Desktop. Instead of opening where I can see it, it went to some other Desktop, presumably the one it was in when it was ...
1
vote
0answers
27 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
65 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
23 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
10 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
68 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
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
0answers
24 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
56 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
344 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 ...
1
vote
0answers
43 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
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 ...
1
vote
0answers
70 views

AppleScript to extract email address from body of email and send auto response?

Is there a way with AppleScript to extract a contact link in the body of an email and send an auto response with apple mail? (I'm running Yosemite) I would like to auto respond to leads I receive ...
1
vote
0answers
89 views

How to restart Safari (also clearing history and cookies) after being inactive (time based)?

I'm working on a Mac with parental control and it's supposed to be a kiosk Mac. I'm wondering if there is a similar Applescript that can tell Safari to restart after given for example 45 minutes? Is ...
1
vote
0answers
16 views

Dragon Dictate pressing space bar when not recognizing command

I'm using yosemite 10.10.5 with Dragon Dictate 4 and 5 I had this problem. Whenever I say a word that is not a command the what appears to be space bar is pressed. In turn, paging down or opening ...
1
vote
0answers
170 views

SecurityAgent Password not getting filled via AppleScript 10.11 El Capitan

My AppleScript no longer seems to work in 10.11. I put quite a few debug statements in my script and it doesn't seem like the script continues to run after the dialog appears. Does anyone have a ...
1
vote
0answers
34 views

How to create an app with the ability to open files in finder with right click

I want to create a very simple app like this: #!/bin/sh /opt/local/bin/evince $1 evince is a pdf viewer I compiled in OS X. I want to navigate to a pdf document in finder and then right click and ...
1
vote
0answers
42 views

Email message duplicated from AppleScript

I'm using the following AppleScript within a rule to auto forward emails to Evernote. The issue I'm seeing is the email is duplicated in Evernote. Within Evernote the note contains the email twice. ...
1
vote
0answers
90 views

How do I use Applescript to reply to an email?

Specifically I'm looking for a simple tweak in the Mail app. I have a rule set up to "Reply with text" to certain emails that come in, but one source in particular (Trulia) emails me messages from ...
1
vote
0answers
85 views

Set environment variable for iCloud Drive path

Foreword Setting env vars on Yosemite seems to be really a pain, but I've managed doing it thanks to this clever way: ...
1
vote
0answers
49 views

Applescript - How to Create a Contact IN a specific Account?

I am using Applescript on Yosemite 10.10.4 to create contacts in the contacts app. I have two iCloud accounts configured on my Mac. One personal (The "main" iCloud account) and one business. ...
1
vote
0answers
95 views

I need to batch move files from one location to another, and put them in pre-existing folders with the same first 7 characters

I am looking to automate moving large amounts of files. Basically I have one location on our network full of .zip files. They are all named like "12-3456.zip" etc. I need to move each of these .zip ...
1
vote
0answers
53 views

OSX Flush DNS without sudo

I have a Mac that keeps messing up its DNS (this may be a wider network issue, we have windows clients that are having problems too). Whilst I try to understand the DNS issue I'd like to set an 'icon' ...
1
vote
0answers
103 views

How to: Automator, launch an app, as if I dragged n dropped file on App's dock icon?

Using automator, I know how to "Launch an App". I would like to know how to "Launch an App in a specific way". The app I want to launch, acts differently depending how its launched. If one: clicks ...
1
vote
0answers
103 views

How to detect if chrome (or any other app) is playing sound using bash/applescript

I am writing a script to turn off audio on my mac, but need to check if its coming from the browser or an app (say Spotify). Is there a way to detect which app is playing sound?
1
vote
0answers
75 views

How can I programmatically read and write the texttone of a Contact in the OSX' Contacts app?

On the Contacts app (V9.0) of Mac OSX 10.10 Yosemite I want to read and write programatically the texttone property in some of my contacts. How can I do this with Applescript or another scripting ...
1
vote
0answers
45 views

How do I automate selecting files in a .jar file?

My .jar file has a number of buttons that, when clicked, prompts me to select a file to load. I need to find a way to get this file selection to be automated, and decided on applescript. ...
1
vote
0answers
39 views

Forcing application to go to selected window on startup

I run a multi-monitor set-up on a single "Desktop". All of my applications when opened run on the primary monitor, which is the smaller monitor. I would like to have some (e.g. browser, mail client) ...
1
vote
0answers
53 views

Help with Applescript to paste text into Word

I've just started using Apple Script and I was trying to make Word paste some text in an unformatted way. This is the code I am using: tell application "Microsoft Word" tell selection try set theClip ...
1
vote
0answers
279 views

Start QuickTime and set camera to iPhone from command line

I'm attempting to start QuickTime from AppleScript and select the camera of my iPhone like I do from QuickTime. I can't seem to make it change the camera. The script I have now is: tell application ...