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
1answer
43 views

How can I toggle network services with a script?

Currently I can do this only on a per connection basis using this script: property status : "none" property val : "none" on get_status() set status to do shell script "sudo networksetup ...
-2
votes
1answer
30 views

AppleScript Syntax Error

For some reason, when I attempt to run this code in AppleScript, I get the following error: Syntax Error Expected end of line but found “"”. Here is the troubled portion of my code: if a = ...
0
votes
0answers
23 views

How to quit a Chrome application using AppleScript?

I am using this Chrome app to conveniently handle my email as if I am using a dedicated app. I would like to be able to quit it from AppleScript. How do I do that? tell application "Google Chrome" ...
0
votes
0answers
36 views

Open SSH server files automatically with AppleScript

I am trying to build an Apple Script which will: 1. Open terminal login in SSH with details 2. After login, open a python script which is on ssh server automatically I want to do all of these tasks ...
5
votes
0answers
47 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 ...
0
votes
0answers
43 views

Mail.app rule to run Apple Script that puts message content into a variable

I am trying to learn Apple Script by writing a script that will automate extracting text from an email when it arrives. When ever I receive an email from a specified sender I want to save the text ...
0
votes
2answers
56 views

How do I run a terminal command for different values

How do I have to label i such that the do command is repeated for all values of i. E.g. if i =2: cd /Users/xxx/zTree; wine explorer /desktop=1,640x480 zleaf.exe /language english /name lab1 cd ...
0
votes
0answers
17 views

Notes script to recursively walk directory structure?

I previously asked this question, for getting a list of notes in a specific Notes folder. I am trying to generalizing into something more like accessing a folder in a filesystem. One problem is that ...
1
vote
3answers
77 views

Copy specific files and keep the subfolder structure

I got a folder with a large amount of files with different suffixes in several sub folders. My automator workflow works as follows: Ask for Finder Items Get Folder Contents (sub folder option ...
0
votes
0answers
25 views

Change Geektool image using script

I'm looking to have an image display for a keystroke and then revert/change to a transparent image after a few seconds. I'm using an AppleScript file and image geeklet. The URL (or temp) image file, ...
1
vote
0answers
31 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 ...
0
votes
0answers
28 views

Microsoft Word on OS X running executable hyperlinks from 'launchd'

I'd like to create a script that calculates statistics on all opened applications and what parent process has initiated them. I would expect that the ppid for each running process will represent the ...
0
votes
1answer
32 views

Geektool coding to remove image after a set time

I'm trying to edit a 3rd party script written in AppleScript (OAS...I think) to dim the volume after showing changes. I've tried changing the opacity & switching to a transparent image using a ...
0
votes
0answers
16 views

How to handle a save-dialog with System Events

Logic Pro X is only scriptable with "System Events", because it has no AppleScript library. I have to close a project in LPX and it works: tell application "System Events" to tell process "Logic Pro ...
0
votes
1answer
48 views

Switch spaces with apple script

My goal is to switch spaces from within an apple script. My shortcut to switch to the 4th space is ctrl+4, but when I tried this in an apple script nothing happens: tell application "System Events" ...
1
vote
2answers
42 views

Global hotkey that send keystroke to another app

I want to configure a global hotkey like F5, and when I press F5 it should send [Command]+[Option]+[Control]+[Up Arrow] to the Skype app. Anyone knows an app that I can do this, or script.
1
vote
1answer
75 views

Get current app from two instances with same name by Apple Script

How to address an active window of an active app by AppleScript when two instances of the same app are running? The script below addresses the other app. Probably because the name and id of the app ...
0
votes
0answers
21 views

AppleScript: Trouble controlling Spotify over eppc (Apple Remote Events)

I would like to know if it is possible to control Spotify remotely using AppleScript. Spotify has a nice AppleScript dictionary, and I can control the software successfully as long as I do it ...
1
vote
1answer
29 views

How can I use the automator to create text-to-speech service that talks faster than the current service?

The text-to-speech service has a speaking rate option that goes from slow to fast. But the fast option is not fast enough (its 300 words per minute). I just tried to create a service. I simply ...
0
votes
2answers
59 views

How to check which files have been copied to the main hard drive and which ones have not been copied?

I formatted my MacBook main drive some months ago and, in order to not lose data, I created a .dmg image of the hard drive before the formatting procedure and saved it to an external device. Then, ...
0
votes
2answers
41 views

Cannot Run GUI AppleScripts

I recently upgraded my system to OS X 10.11 El Capitan and ever since, my AppleScript which enables GUI scripting cannot be run. Part of the reason is obvious, the Universal Access pane in System ...
0
votes
1answer
24 views

Having problems with an AppleScript

This isn't launching FaceTime when I want it to! I want it to launch an app, and you get to choose what app it launches, so if I press Google Chrome, then it launches Google Chrome, but it doesn't ...
0
votes
0answers
49 views

Converting .VCF to .CSV

I'm trying to get a group of contacts from BusyContacts to MailChimp. I have exported the group as a VCF file. Now I need to convert that VCF file to CSV. When I open my VCF file in a text editor, ...
1
vote
1answer
46 views

AppleScript help

I'm trying to make an app that will open different apps, and give you a list, but I keep getting error messages. Is it possible to do this? display dialog "Hello and welcome to my app!" buttons ...
1
vote
1answer
35 views

Applescript change folder and terminal commands

I have tried the following but cannot seem to get this to work: do script "cd ~/desktop/test; for x in ls -1 | sed -e 's/^\(.\).*/\1/' | sort -u; do mv -i ${x}?* $x done" I'm wanting to perform ...
1
vote
1answer
38 views

Apple Script to Export from application

I'm new to AppleScript and wanted to export my citations using AppleScript. I found the following but am not sure the structure to change the following to my path folders, can you please provide an ...
0
votes
0answers
11 views

Controlling Scroll Bars

On our company page in LinkedIn, under the analytics tab, there is scrollbar. I want a script which will scroll down to the bottom, hit "see more", and recursively continue until the data is ...
0
votes
1answer
33 views

Temporary Folder Difference for Apple Script

This seems to work as a temporary folder in Apple Script path to temporary items but path to temporary items from user domain is also recommended to use. Which one is correct and safe to use? ...
1
vote
1answer
80 views

Temporary Folder Path for Apple Script

set targetFile to (path to temporary items as string) & fileName I am trying to download a web image to temporary folder by curl in a Apple Script. According to the above code, the curl ...
1
vote
2answers
42 views

Can I change the button “m” with space bar?

My space bar won't work so I want to use the m button as space bar. Is there a way to do that? Maybe with the Automator using an apples riptide or something?
0
votes
1answer
35 views

Notes script to access notes in specific folder?

I have tested this Notes export script (https://github.com/alexwlchan/notes-export/blob/master/notes-export.scpt). It seems to work, but the issue is that I want to specify a specific Notes folder to ...
0
votes
1answer
89 views

Terminal Command into Applescript

I have the following terminal command that I want to automate using applescript. I also would like to have a command to cd directories to the folder where I want to apply the command first. After cd ...
1
vote
2answers
62 views

Disable Screen Sleep AppleScript

Is there a way to turn screen sleeping on and off temporarily through AppleScript? I'm making a script at the moment that will run for a few minutes when I'm away, so I don't want it to sleep, but ...
0
votes
1answer
28 views

App made in Applescript Icon wont change

The app's Icon wont change for me I tried copying in contents as "applet.icns" I tried Copy + Paste in get info nothing will work I found a article on the internet about this problem they say that you ...
2
votes
1answer
591 views

Batch compress multiple folders into individual zip files

I have dozens of folders that I need to compress into individual zip files. If I select all of these folders in the Finder and do "Compress [X] Items," I get one zip file containing all of the ...
0
votes
2answers
25 views

Change installed AppleScript version

Is there any way to change the installed version of AppleScript? After mistakenly identifying my version of AppleScript as 1.0 by using a 15 year old script (turns out that just checks the version of ...
0
votes
1answer
28 views

Applescript : Only run the script if specific input is entered

Is it possible to run an applescript ONLY if a specific input is inserted If I put in my attempts at the code i might be clearer at what Im getting at set x to display dialog "What is your password?" ...
1
vote
1answer
35 views

If “STOP” Is typed do this

Would it be possible For example would it be possible for me to code a very simple repeat code but say If I just typed STOP that it would end the program here is my beginning code for the repeat. set ...
0
votes
0answers
54 views

Is it possible to simulate a continuos press in AppleScript?

The closest solution to a continuous key press that I know is just repeating a key press a certain number of times: repeat 1000 times tell application "System Events" to keystroke "c" using ...
0
votes
1answer
37 views

Script opens two terminal windows

I coded this little AppleScript using Automator: tell application "Terminal" do script "myscript" end tell This perfectly works but has a side effect: when I close the window, there's always the ...
0
votes
1answer
48 views

How can you access Apple Mail from Apple script?

I want to archive old emails ( say, older then 7 days ) from my inbox automatically with an applescript scheduled via cron. To be honest, I am open to other Apple-friendly languages such as Swift or ...
1
vote
1answer
176 views

Get AppleScript Path of Parent Folder

I am writing an AppleScript that will be run from a USB drive, but the dive name may change often so I need to figure out how to get the directory path of the parent folder that contains the script. ...
1
vote
1answer
58 views

How can I run a shell script with admin privileges from Applescript?

I am writing an Applescript that aims to automate the install (add to root keychain) and 'Always Trust' setting by simply launching the Applescript. I'm stuck with how to get the admin user ...
0
votes
1answer
38 views

Swaping spaces between monitors

Given that I have 'mission control/displays have separate spaces' unchecked: is there a way to swap spaces between displays (and assign a shortcut to it)? For example: if I have 'Desktop 4' on the ...
0
votes
0answers
21 views

AppleScript Automator back-compatibility

I made a little, easy AppleScript and used Automator to launch it on click: tell application "Terminal" do script "myScript" end tell What about back-compatibility? Can I run it on every previous ...
1
vote
1answer
83 views

Automator workflow / app to refresh a given tab in Safari (or even Crome)

When I am coding my Rails app I am switching back to Safari quite often to refresh my local version of the site to see if my changes are correct. It would be awesome to just hit one of the function ...
0
votes
1answer
134 views

AppleScript Save As Dialog in Safari Reader Save As PDF

I have an AppleScript to open move a Safari webpage into Reader view and then to Save As a PDF. I would like it to Save As the PDF with default filename, but always in the same specific location. I'm ...
1
vote
2answers
90 views

How to put a Mac to sleep after display disconnect using AppleScript?

I would like to solve the issue from this question, namely, after disconnecting a Cinema display from a clamshell MacBook I would like to let the MacBook go to sleep without opening and closing the ...
0
votes
0answers
19 views

AppleScript to Like a SoundCloud Track using System Events

I'd like to create an AppleScript to like a SoundCloud track. Since SoundCloud supports keyboard shortcuts, I tried to use System Events. (l "ell" is the shortcut.) This is what I have so far, but ...
1
vote
1answer
50 views

AppleScript : Download to a AFP drive

I try to download files to a AFP drive but always have "Warning: Failed to create the file /Volumes/home/Downloads: Is a directory " But the last command work fine tell application "Finder" to ...