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
60 views

Using 'kMDItemContentModificationDate' in 'do Shell Script'

I want to find files modified on a specific date. It is not important what time of day they were modified. I tried the following and got an empty list (no error): set theFolder to (choose folder) set ...
0
votes
1answer
76 views

AppleScript - mdfind kMDItemTextContent script to find specified content from display dialog query

I have this AppleScript find all documents whose content matches the text 'theMessage' and it works perfectly fine: set matchText to paragraphs of (do shell script "mdfind \"kMDItemTextContent == ...
0
votes
0answers
84 views

Applescript - Check if a specific window pops up, then do this

I'm building an Applescript that launch FileZilla, then import a queue from an xml file. The problem is, when a download was previously started and the file already exists on the disk, FileZilla pops ...
1
vote
0answers
173 views

Automount afp Volume with AppleScript

I know this is similar to other open questions about mounting network drives, but this one is slightly different. I have an AppleScript that runs at startup that looks like this: tell Application ...
1
vote
0answers
23 views

Filling areas of Json script with user prompts

I am wanting and Applescript to fill certain parts of a Json script via user input prompts, but not sure how to place the results in the correct areas? And to then have the result copied to the ...
0
votes
0answers
99 views

Applescript commands to move an app window to a specified space

I’m trying to write an applescript to launch all of the applications I typically have open, then move them to the desktop on which I typically put them (for example, my mail client is on desktop 4 and ...
1
vote
0answers
44 views

How do I simulate a random VPN disconnect?

I'm trying to write an applescript that reconnects a VPN that gets disconnected (sort of like this one) and I want to test it to see if it works. One of the key parts of the script is being able to ...
0
votes
1answer
80 views

Key stroking fn + f8

I need to make an applescript to press the keys fn + f8 at the same time. The only problem is those are both keys without names! tell application "System Events" key code 63 -- Will press the fn ...
1
vote
1answer
77 views

Sort Contacts Marked As Company

I found an Applescript at apple's support site to sort any contact with the "Company" checkmark checked into a "Business" group: property groupName : "Business" tell application "Contacts" if ...
0
votes
2answers
281 views

Run AppleScript for Specific Monitor

I've enabled Dictation for command prompts via voice [got it from the OS shipped Chess application in Lion]. Decided to give it a go System Wide now in 2015 running Yosemite. I fancy it so far, ...
1
vote
0answers
39 views

Apple Script notification bubble - quick reply style prompt

I know that you can trigger a notification using Apple Script: osascript -e 'display notification "Hello" with title "How are you feeling?"' However, I also want to be able to prompt for certain ...
0
votes
2answers
292 views

How to use AppleScript application with “open file -a AppleScriptApp”?

Some information about what I am trying to achieve I am using emacs inside of terminal. I know about existence of cocoa versions of emacs (like GNU Emacs for OS X, Aquamacs and Emacs Mac Port). But I ...
2
votes
0answers
45 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!
3
votes
1answer
512 views

What's the equivalent of “do shell script” with javascript automations? (Yosemite)

Support for javascript automations started with Yosemite. How could I run using javascript an external command? (i.e. the equivalent of do shell script of applescript?
1
vote
0answers
100 views

How to execute javascript from an applescript (Yosemite)?

Since Yosemite, the Script Editor allows using javascript. What is the best way to execute javascript from an applescript? My use case is an existing applescript which needs to send some parameters ...
0
votes
1answer
132 views

AppleScript referencing tabs suddently breaking on Chrome

I've been successfully using a script for a long time, which uses Chrome to calculate execute some javascript and return the result. tell application "Google Chrome" tell window 1 tell ...
1
vote
3answers
178 views

Using Applescript to fool key logger with keystrokes?

So I don't know much about how Mac processes keystrokes, but if I wrote a simple AppleScript that opened a TextEdit document and started typing a huge block of text, would this effectively mask my ...
0
votes
1answer
67 views

AppleScript from Terminal unrar command

I would like to know if it's possible to make an AppleScript of the following terminal command(s). cd unrar e -r -o- *.rar && find ./ -name “*.r*” -delete Also, I would like to know if it's ...
2
votes
1answer
526 views

Get current path of Automator app

I am trying to create an Automator application which I will be distributing to other users on the network. The automator app will be accompanied by a ZIP file and a PKG installer file. I need to run ...
0
votes
1answer
313 views

Applescript not returning string

I have a list called num. I have converted it into a string. I want to return that string so that the next action called "New text file" in my automator workflow can get the string. This is my code - ...
0
votes
0answers
98 views

Changing app icon in order to change mini window icon

I have an app bundle on my desktop. I change its icon by changing the icon in its /Contents/Resources/ folder. This updates finder. However I am trying to update the dock. I have figured I can ...
1
vote
1answer
252 views

Selecting files for input Safari applescript

I am trying to automate using Applescript uploading of files to a website. I have gotten to nearly the last step, but can't seem to get a Finder (file chooser) window to respond to scripts. Here is ...
0
votes
2answers
241 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
215 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
131 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
193 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
77 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
200 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
181 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
250 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
139 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
173 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
52 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
363 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
91 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
402 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
34 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
123 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
113 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
183 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
127 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
379 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
113 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
166 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
202 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
43 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
324 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
116 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 ...
5
votes
4answers
3k views

AppleScript “delay” command 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
27 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 ...