AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

3
votes
1answer
2k views

Applescript create event in calendar, how do I remove the default alert?

Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this: set theDate to (current date) tell application "Calendar" tell calendar "Calendar" set timeString ...
3
votes
1answer
697 views

How can I run an AppleScript or shell command on Mac OS X at screen unlock?

Note that this is not the same as startup or login. I never log out of my machine and I want to run the script whenever I unlock the machine to start working.
2
votes
1answer
806 views

Set OS X application preference to stop prompting for admin password

I am trying to write an applescript that sends some actions to an application (specifically waterroof). The problem is, the application periodically asks me for the admin password when I open the ...
2
votes
1answer
447 views

OS X Lion: AppleScript unbearably slow for moving Mail messages

I've been using for years now the following applescript, triggered via iKey by an F12 keystroke: tell application "Mail" to move (get selection) to mailbox "Archive" I'm using it to move inbox ...
2
votes
1answer
582 views

Different Wallpaper if two monitors are attached

I am working on my MacBook Pro. In the office I have 1 27" Monitor attached to it, at home I tend to work without an second monitor. For that setup I want to change the wallpaper if no 2nd monitor is ...
2
votes
1answer
815 views

Save as PDF to Folder Script for Apple Mail

I want to add a script to a rule to auto-print messages as PDF to a specific Folder. What I found was this: http://is.gd/acmsE but it doesn't work for me on OS X 10.6. I already know the Save to PDF ...
2
votes
1answer
982 views

Save and reopen Spaces configuration in Mac OS X

Let's say that I am working using several spaces. In one of them I have 20 applications opened with their respective files. My computer crashes and I have to open everything again. Instead I want to ...
2
votes
1answer
81 views

Are Snow Leopard text substitutions scriptable?

I prefer using typographical quotation marks when possible, so I love the Smart Quotes part of Snow Leopard’s text replacement feature. But there are a few cases in which I need to toggle it, and it’s ...
1
vote
1answer
90 views

How to allow an application in Mountain Lion in the “Security and Privacy” settings?

Every time I was trying to use an Alfred workflow written in Applescript, I got the error "No user interaction allowed". In Mavericks there is an "Accessibility" option in the "Security and Privacy" ...
1
vote
1answer
269 views

Sorting Files into Subfolders based on EXIF Date

I have a huge directory from a HDD recovery that contains 70000+ JPEG files. I tried playing around with some AppleScripts, that I found, but had no luck. I already installed EXIFtool, which might be ...
1
vote
1answer
28 views

Register a file specified by open

So I have this small bundle with applescript made, and it even seems to work as it should. However, it appearently doesnt open my files when it is asked to via the open utility. It works though when I ...
1
vote
1answer
220 views

OSX script to Check if ffmpeg process has stopped

I have a Automator Workflow that uses Videobox to convert flash videos for multiple devices but cannot tell when it finish a conversion,I know that it uses ffmpeg for its conversion as I can see it in ...
1
vote
1answer
340 views

Applescript to shell script watch folder

I am trying to setup a watch folder so that when a file is added to a folder, I can run a shell script...for this purpose I made a simple test but cannot make it work... Here is my applescript on ...
1
vote
1answer
199 views

iTerm 2 change row size using AppleScript

I want to change the height of my terminal window using a script. Currently this is what I have come up with: tell application "iTerm" activate tell the current terminal tell the ...
1
vote
1answer
1k views

Pass arguments to osascript via shell function in OS X Mountain Lion

The answer in How to open a new Firefox window with URL argument is broken in Mac OSX Mountain Lion (10.8.2). I can't comment on that answer or question, so I had to create a new question. It fails ...
1
vote
1answer
200 views

How can I pause growl notifications via Terminal/Shell?

I was wondering if there was a way I could pause (hide) growl notifications from the command line? Failing that, is there a way to do this with an AppleScript?
0
votes
1answer
111 views

Target Display Mode not working when no keyboard present

When I try to use some kind of command + f2 command either via applescript or screen share, it never works when the keyboard is no longer present. Example, I have an iMac and a laptop where the ...
3
votes
0answers
666 views

Applescript to connect to bluetooth device

I'm trying to create an applescript to allow me to connect to a bluetooth device by it's Bluetooth ID. So far, i've managed to get an applescript to turn on bluetooth if it's off. Here's the code: ...
3
votes
0answers
327 views

iTerm2: How to get output of a shell command with applescript

I want to get the output of a shell command run through iTerm2's applescript into an applescript variable. I tried the following but it does not work: tell application "iTerm" activate try ...
2
votes
0answers
88 views

Applescript Adobe Updater

So, I am new to Applescript editor and I am trying to write code to automatically update computers. For some odd reason I can not seem to get Adobe to update successfully. I tried using Accessibility ...
2
votes
0answers
264 views

Script to join WPA2 Enterprise wifi

When I head to work with my MBP running OSX 10.7, I have to go through this series: Join Other Network Enter SSID select Security = WPA2 Enterprise generate a pw via my RSA soft token Join ...
1
vote
0answers
24 views

Mail.app rules not triggering

I have a mail.app rule set up to run an applescript when incoming emails come in with a certain subject, but it does not trigger. I see the emails in my inbox, and the rule is activated, but it does ...
1
vote
0answers
185 views

AppleScript shows “Document could not be opened. You don’t have permission.” but file can be opened?

I am getting a "The document [filename] could not be opened. You don't have permission" when attempting to access several files in an AppleScript. However, I can open these files manually without ...
1
vote
0answers
175 views

Applescript + pdfpen for ocr on multiple files: how to move on when pdfpen freezes

I'm using the following AppleScript to batch-process pdfs for ocr: tell application "Finder" set target_folder to target of front Finder window repeat with i from 1 to count (every folder of ...
1
vote
0answers
152 views

Applescript app. won't force OSX to connect with VPN on Mac 10.8.4

I set up an applescript application (saved under the name "BTGuard VPN-OSX) to force OSX to connect with my VPN service (BTGuard). I followed instructions from this link ...
1
vote
0answers
244 views

Trying to re-direct emails as plain text using Applescript. Code (inside) isn't working, any help would be great

I have users sending mail through Outlook which formats the text as Rich text. I'm trying to create script where a "catch-all" email address intercepts the email, converts it to plain text then send ...
1
vote
0answers
138 views

Add a contact from an email address within email text

I came to Office/Outlook 2011 from Mac Mail, and now I find that I'm unable to do something that I need to do ALL THE TIME. In Mail, if there was an email address within the text of an email message ...
1
vote
0answers
134 views

Switch between Tabs with Applescript

I have a cocoa-applescript application whose GUI interface has 3 tabs.The identifiers for these 3 tabs are "item 1" "item 2" and "item 3" respectively. Tab1 is the default tab with a form on it. Tab ...
1
vote
0answers
123 views

Desktop Picture Placement

I made an Automator app that changes the desktop picture to whatever image file you drop on its icon. It used to work perfectly until Snow Leopard. Now the image placement always resets to Full ...
1
vote
0answers
167 views

process pdf attachments with applescript and pdfpenpro

I've set up a gmail account that will contain nothing but emails with pdf attachments. I've also set apple mail up to check this account. Now, I would like to set up an applescript to take the pdfs ...
0
votes
0answers
23 views

Lync Contacts on Skype not found via AppleScript

When I run the following AppleScript my Lync contacts (added to Skype and visible in my contacts list) are not returned, only native Skype contacts: tell application "Skype" ...
0
votes
0answers
14 views

Closing SugarSync Mac app window with AppleScript

I am trying to set up an AppleScript that will open some apps (including SugarSync) after startup so I don't need to have them as login items. It works, except that with SugarSync it also opens the ...
0
votes
0answers
40 views

MAC OS X - remote SCCM 2012 R2 client installation

I have came across a task to deploy CM client on couple MAC devices in order to manage them. I've watched several instruction videos about how to setup the site server and I'm pretty much clear on ...
0
votes
0answers
92 views

accessing mail attachments with AppleScript in Yosemite

I have an AppleScript to save the attachments of an e-mail message. It worked under OS X 10.9 (Mavericks). Now, with OS X 10.10 (Yosemite), it seems that every attempt to access "mail attachments" in ...
0
votes
0answers
35 views

AppleScript and MacOS X for launching App with credentials

Good day, I haven't done a lot of Scripting, and I need to find out how to make a shortcut for an App on the Desktop that will include the user name and password (so they don't have to type each ...
0
votes
0answers
22 views

applescript permissions for copied files

Using applescript, I'm copying PY files to a location in OSX. However, they don't compile when I load Python, it seems because the permissions havent been set on the files. When I look at "get info" ...
0
votes
0answers
36 views

Read a notification from OS X Notification Center using AppleScript

Is there a way to gain access to OSX Notifications with an AppleScript? For example, a notification is displayed: Skype - John says: Do you have time? The AppleScript would detect the new ...
0
votes
0answers
32 views

(osX) Applescript to run compile shortcut in TexShop not working while in Sublime Editor

I'm trying to write an script so that when I'm in Sublime I can use a keyboard shortcut to get it to: save in sublime compile in TeXShop (I'm using it with the external editor setting) then switch ...
0
votes
0answers
51 views

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

I want to initiate a Google Hangouts phone call with Applescript, or Terminal ... or python. (Hangouts.app has an AS dictionary, but with only the default suites.) Basically I want to emulate ...
0
votes
0answers
58 views

Batch format and convert word documents in mac OSX

I am looking for a way to format multiple word documents (in a same formatting) and then save them as PDF. Specifically: Format orientation, page margins, page columns, and font. Save the formatted ...
0
votes
0answers
69 views

Applescript to run when connection to specific network on OSx

I have an apple script that I can manually run that will connect to a couple network drives. I would like it to have that script run when my mac connects to a specific wireless network connection ...
0
votes
0answers
42 views

Applescript for Hotspot Shield

I'm trying to build a simple Applescript to control the 'Connect' and 'Pause Protection' buttons in Hotspot shield VPN, but there is no applescript dictionary or menu bars for the programme. Does this ...
0
votes
0answers
18 views

Prevent application from detecting screen zoom on Mac OS X

I have an application which streams live television, using a rather expensive portable mobile decoder. And for some reason the company that controls the app has decided to limit the screen size of the ...
0
votes
0answers
23 views

Applescript won't open applications on my external monitor

I'm trying to open a new MacVim window with Applescript, and have found partial success with this: do shell script "cd \"~/code/application\"; ~/bin/mvim > /dev/null 2>&1" This works ...
0
votes
0answers
88 views

Can one show or hide the Mac OS X on-screen keyboard via either keystroke or API?

I would like to show and hide the Mac OS X on-screen software keyboard (fig. 1) with a keystroke, but no actions to do so are available when customizing the keyboard shortcuts via System Preferences. ...
0
votes
0answers
128 views

disabling password require via applescript freezes Mac

I wrote little script to enable/disable screensaver and password check. Idea is that when my iPhone is near to my Mac (Proximity app checking this), screensaver and password check should be disabled. ...
0
votes
0answers
71 views

Changing Mac OS X text-to-speech voice per contact in Messages.app

I am quite enjoying using the Speak Events.applescript handler in my Messages.app. It speaks the incoming messages. I'd like to have a male voice for my male contacts and a female voice for female ...
0
votes
0answers
193 views

OSX : Find all zip and rar in a selected folder then unzip and unrar

I am in the process of cleaning a huge library of mangas (mostly -but not only- image files ). Each manga has a main folder containing the different volumes, sometimes in .zip, sometimes in .rar. ...
0
votes
0answers
244 views

Force a file to overwrite instead of appending the filename

I've got an application running is OS X that won't overwrite a file with the same filename. It will only append the filename with a 'space 1'. If I write a file more than once I get something like ...
0
votes
0answers
579 views

Script Mail.app to auto-save attachments?

In similar thinking to a previous question, is it possible to script Apple's Mail.app to auto-save attachments from a given address or file type? Presuming it is, what would that AppleScript look ...