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

learn more… | top users | synonyms (3)

0
votes
2answers
169 views

How do I mount a network drive based on my IP address or wifi network?

When I am at work, I mount a number of shared drives to use during the day. At home, I mount drives on my home network for home use. Is there a way that I can automatically mount the correct drives ...
1
vote
1answer
173 views

Can't mount Volume via Applescript as a login time

So I have this script that I saved as an application and added it my login items. tell application "Finder" to mount volume "afp://Data_Cube.local/Scotts Stuff" delay 5 tell application "iTunes" to ...
0
votes
1answer
113 views

How to suspend a virtual machine using AppleScript (when hibernating the Mac)?

I need an application, which will: Activate Parallels Desktop While holding Opt, select 'Actions > Suspend' Activate SmartSleep Minimize SmartSleep Click 'Hibernate' of menu item 'QuickSleep' of ...
0
votes
1answer
170 views

iMessage speech (applescript) timing out after upgrade to yosemite

When I receive an iMessage, chat or Message on my desktop (iMac), it is read out loud. After the upgrade to Yosemite it does not work. I continue to receive the message that "AppleScript timed out." ...
1
vote
1answer
60 views

Is there a way to kill an unresponsive applescript launched by an application without killing the application?

I've got an AppleScript that I usually launch out of Quicksilver, but occasionally, the script hangs, never exiting. (I think it's waiting on a non-existent window to appear). This results in ...
0
votes
1answer
164 views

Programmatically Change Screen Saver “Start after” time

I would like to change the time before my screen saver starts based on WiFi network. I am running Yosemite (10.10.1). I will use Keyboard Maestro to trigger the action. I need to find the correct ...
0
votes
1answer
114 views

Click on a button (that is not a button ?) with Applescript or Javascript

Okay, relative newbie here, but I have searched all the answers and tried most of the suggestions and cannot find a way to automate using Applescript or Javascript within Applescript to click a button ...
3
votes
0answers
191 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 ...
2
votes
1answer
115 views

How to get file path of user selected .icns file in applescript?

I'm writing an applescript in which I need the POSIX path to an .icns file that the user selects. For some reason though, it refuses to accept .icns as a valid file type. This will work: set Icon to ...
0
votes
0answers
157 views

Applescript not working anymore with Yosemite Mail Rules

Here is the script that use to work pre-Yosemite. Now it's doesn't work at all. Anybody have any suggestions on how i can get this to work? using terms from application "Mail" on ...
1
vote
2answers
45 views

script to preview two .png s side by side?

I want to display A.png and B.png together, A left / B right or A top / B bottom. I can of course preview A.png preview B.png separately, then resize and move the two windows next to each other, ...
0
votes
1answer
278 views

Applescript read specific data out of iWork Numbers

I am trying to get data out of a table in Numbers. I have an index number, I need to get the name associated with it in applescript. (Eventually I need to set names of files with one of columns of ...
0
votes
2answers
74 views

How to get a value from a list with a string in AppleScript?

What I try to achieve is that the dialog should output the IP adres that is in the list. set ipList to {DNS1:"8.8.8.8", DNS2:"8.8.4.4"} set input to "DNS1" set output to input of ipList display ...
0
votes
1answer
333 views

Trigger function key using applescript

I'm trying to trigger a function key using applescript. The increase volume 'key' for example. I wrote the following applescript but it isn't effective: tell application "System Events" key down ...
0
votes
1answer
33 views

Global keyboard shortcut to switch to an application (to use with Emacs/Aquamacs)

Like in iTerm, I'd like to be able to set a keyboard shortcut to switch to an application, which in this case would be Aquamacs. This would be really useful to know in general. Would an Applescript or ...
0
votes
0answers
104 views

Automator: Verify connectivity to server, if yes, then copy files to server. If no, wait until available

I also asked this question on the Apple Discussion forums, but have had no replies.. Details required: I'm already able to copy files to/from server.home (Windows 2008 r2) via SMB, both within the ...
1
vote
1answer
85 views

Why is my script editor coming up with connection invalid after running it for a while?

This is the script I've found on the web I'm trying to just have the script drop items for me by pressing 1, but it works only for a little while before script comes up with an error "error "System ...
1
vote
1answer
157 views

screensaver causes error “share does not exist on the server” to endless loop

I've been trying to learn to automate my home Mac environment with Applescript. I've had some success, but am running into seemingly inconsistent and troublesome errors. In order to diagnose the ...
0
votes
1answer
100 views

Script Editor crashing when running Applescript

I need to extract the phone number of all the contacts in a particular group and for that I am using the following code - on run {input, parameters} tell application "Contacts" set ...
7
votes
2answers
254 views

Why are Script Editor .scpt files not saved as plain text files?

The Script Editor (formerly ApplerScript Editor pre-Yosemite) saves .scpt files as binary files, not plain text files. It makes working with them in source code control systems somewhat cumbersome. ...
1
vote
0answers
89 views

Extract links from email based on the anchor text, not the href

I am putting together an Automator workflow that will allow me to bind a hotkey to a Smart Mailbox listing and effectively automate the task of clicking "Unsubscribe" in emails which have that text ...
0
votes
3answers
139 views

Can I set the primary Language of OS X by using shell script or AppleScript?

My computer is mac mini (late 2012) with Yosemite 10.10.1 installed. The primary language of the system is English, with Chinese being the second language. Sometimes I need to use the Maps.app, and ...
2
votes
0answers
176 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 ...
0
votes
0answers
38 views

Automator: Delete source images after importing them is not working

I have an automator script that takes photos from a particular folder and adds it to a particular album in iphotos. One of the function block used is Import Files into iPhotos. with the option ...
2
votes
3answers
268 views

Help with a simple email script for OSX

I would be so happy if someone could assist me in creating an Applescript to send some emails. I have seen a few examples but I am not confident that I can adapt them to my own needs. I need to send ...
4
votes
1answer
86 views

What are the differences between Applescripts saved as *.scpt and *.applescript?

It seems to me that those scripts that are saved as *.applescript are always meant to be the raw, uncompiled text while those that are saved as *.scpt can be either the raw text or the compiled ...
4
votes
3answers
2k views

Applescript Delay not working since switch to Yosemite

Ever since I upgraded to Yosemite, Applescripts that use delays have stopped working. How can I fix this? Here's the world's simplest Applescript, for the sake of an easy example: set volume output ...
0
votes
0answers
22 views

imagesnap code not doing what it should

I edited most of this code from the website below (not a hyperlink because I'm just giving credit. http://hints.macworld.com/article.php?story=20100117064356428 So fairly simple script just build a ...
0
votes
0answers
74 views

Can I configure calendar alarms from automator before they are created?

In automator you can make calendar alarms that are ridiculously useful. One that I often use is a little automation that will create and send an email whenever the calendar alarm is triggered by the ...
1
vote
1answer
54 views

Can I add actions to control automator to automator?

Is there any way that I can add automator itself to the list of services I can automate? For example right now I can go and add a launch application action to the workflow and within that action ...
0
votes
0answers
43 views

Hooking into establishing Wi-Fi connection on Yosemite

Is there a way to hook into the process of establishing a Wi-Fi connection for executing some arbitrary actions (i.e. scripts or something) on certain events like connection established, connection ...
1
vote
1answer
67 views

Applescript to open Get Info box for the previous iTunes track?

I like having a hotkey to bring up the get info box for the current iTunes track so that if I'm using another app and a song comes up, I can quickly edit it. This works (though if it's not the best ...
1
vote
0answers
15 views

Toggle notification center's DoNotDisturb from terminal [duplicate]

Is there any way to toggle it with i.e. osascript? I'm on Yosemite.
1
vote
4answers
138 views

AppleScript executes itself again after a reboot it initiated. How to avoid that?

I have a shell script that is run by an AppleScript app. That shell script restarts the machine at some point with shutdown -r now. How can I avoid having the AppleScript application automatically ...
1
vote
1answer
43 views

CD-ing a file to itself

I wrote an application in Applescript to open a black picture and fullscreen it in preview. I need the app to "cd" to itself, no matter where it is. That means if it is on the desktop it can pull up ...
1
vote
0answers
32 views

Speed up moving mails in Mail with AppleScript

Moving or deleting mails in Mail with AppleScript is dog slow. One of my scripts is: tell application "Mail" set SelectedMails to selection repeat with currentMail in SelectedMails ...
0
votes
1answer
398 views

Applescript to replace string using sed

I need and Applescript to replace some text as follow: Original text: string  string  string  $  text1 string  string  string  $  text2 text3 string  string  string  $  text4 The ...
1
vote
1answer
75 views

Show the Dock with AppleScript?

I would like to show the Dock when all windows are hidden/closed/minimized. Is this something that can be done with AppleScript? Where can I learn more about the specific capabilities of ...
2
votes
2answers
130 views

Git pre-commit hook that checks for open application

I am using git to manage a project that has a few binary files that need to be closed before being committed. So I need a git hook, that checks to see if the application that has these files open is ...
2
votes
0answers
65 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 ...
1
vote
1answer
81 views

Including Python Script Dependencies (virtualenv contents) in Platypus

I'm trying to turn a python script into a OS X App that you can run directly from Finder. I'm trying out Platypus, which seemed like the simplest option. The problem I'm running into is with the ...
1
vote
0answers
74 views

Applescript Service Won't Run From Some Applications

Okay, so I have a non-Apple keyboard and wanted to bind function keys to the basic media controls such as play/pause iTunes, change volume etc. So I decided to create a service in Automator with an ...
0
votes
0answers
145 views

Mac Reset Password Prompt/Script

So, I'm setting up Mac's for new users. I create their profile and give a default password (the same one) to each new user. My question is, when the user goes into the computer for the first time(it ...
2
votes
2answers
715 views

Run a program/script when the screen is locked or unlocked

Is there a way to run a specified script or program when the screen is locked or unlocked? Ideally a bash function or an AppleScript. Is there an event that I could subscribe to that would allow me ...
1
vote
1answer
101 views

Folder Action for hiding files according to type

Here's what I need. I need a folder action that hides files according to their extensions. (I do not need a folder action that hides extensions for visible files.) This action needs to apply to every ...
0
votes
1answer
274 views

How to set a custom icon inside a signed Apple Script application?

I'm using Apple Script to distribute a signed applet, and would like to use a custom icon. However, as soon as I export it from Script Editor, the bundle loses the custom applet.icns file I put in it. ...
2
votes
2answers
61 views

How to differentiate between applications with the same name in applescripts

I'm trying to use tell application "Google Chrome" in order to script the OS X Chrome app, but this keeps being interpreted as referring to a virtual application with the same name which refers to the ...
0
votes
1answer
144 views

Backup mailbox of mail.app with applescript

I would like to automate, with applescript, the back up a mailbox of mail, which is manually done with the menu "Export mailbox ...", but: I can not set the folder where the mailbox will be saved; I ...
0
votes
2answers
200 views

iTunes/Applescript: get all tracks from (incomplete) album

I try to write an Applescript that would sort playlists by album. That is, a playlist P might contain 20 tracks split on 4 albums (A1, A2…). Each album has 10 tracks, in other words, on this playlist, ...
1
vote
2answers
193 views

Alfred Terminal / Shell Command does not work

In Alfred, if I type > ls must open iTerm2 with that command. Well, does not work for me. In Application if I select Terminal instead of iTerm2, works. If I select Application → Custom, it ...