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
0answers
28 views

Make an applescript that ticks the reopen windows at login box automatically

I'm currently making a script that will logout the user while reopening the windows at login. The problem is a can't find a way to tick the checkbox or specifically, find what process the login ...
1
vote
1answer
26 views

osascript dialog box is blocking.

I'm using osascript to display dialog box from bash script, but it's blocking the script, until i press the 'ok' button. I wonder if there's a way to make this display window asynchronous. osascript ...
1
vote
0answers
38 views

trim Mac files to move to Windows

I have a large number of Mac files that I need to remove illegal characters that Windows will not like and to shorten the file names while preserving the extension. I have found a Bash script that ...
0
votes
1answer
40 views

How can get an applescript to add itself to the open at login menu automatically

In El Capitan how can I get an applescript to make itself open at login? Such as adding it to the login items automatically? I want to be able to send people the applescript and the first time they ...
1
vote
1answer
33 views

AppleScript: Display alert or restart when application terminates/crashes?

I rely on Dropbox for syncing work files between two computes that are powered on 24/7. For some reason, Dropbox terminates (crashes or quits) after long periods of time, with no explanation. I just ...
0
votes
2answers
440 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 ...
2
votes
0answers
42 views

Getting all windows returns inaccurate items

I noticed when getting all windows that there are extra window items returned than there are. For example for Safari, it returns 9 windows but there are only 3 windows open; all the others are ...
0
votes
0answers
22 views

How to make the “Page Down” key on the keyboard move only half the distance as usual

I'm a computer programmer and use Xcode so I am constantly scrolling up and down. Often times I would like to move the page down but not as much as the "Page Down" keyboard key moves it. I would like ...
0
votes
0answers
26 views

How do I delete all attendees from a calendar event using applescript?

I have a script that copies all the events from my work calendar to a calendar I can see at home. Before adding the event to my home calendar, I want to remove its attendees. Can someone tell how to ...
0
votes
0answers
14 views

“Display Notification” stuck in loop in Bash script

Is there any way I can fire a banner notification once through a bash script? I'm trying to modify this BitBar plugin to be a little fancier: #!/bin/sh # <bitbar.title>Gmail ...
1
vote
0answers
18 views

Error when I try to put my computer to sleep

I'm trying to use this script: on run delay 5 set lidState to do shell script "ioreg -r -k AppleClamshellState | awk -F \" = \" '/AppleClamshellState/ {print $2}'" if lidState = "Yes" ...
0
votes
0answers
43 views

AppleScript not putting Mac to sleep

I have this chunk of code: on run delay 10 set lidState to do shell script "ioreg -r -k AppleClamshellState | awk -F \" = \" '/AppleClamshellState/ {print $2}'" if lidState = "Yes" then ...
1
vote
1answer
43 views

Error when using “do shell script”

I'm using a MacBook Pro (Retina, Mid-2014) running El Capitan. I'm trying to create a script that checks if my computer is open or not, and I'm using this: ioreg -r -k AppleClamshellState | grep ...
0
votes
0answers
15 views

Run AppleScript on lid close? [duplicate]

I'm using a MacBook Pro (Retina, Mid-2014) running OS X El Capitan and I'm curious if I can run a script when I close my computer (without installing anything). Note: I don't want to install ...
8
votes
7answers
9k views

AppleScript “delay” command not working since switch to Yosemite

Note: The issue with delay was fixed in OS X 10.11 El Capitan. Ever since I upgraded to Yosemite, Applescripts that use delays have stopped working. How can I fix this? Here's the world's simplest ...
2
votes
0answers
41 views

Applescript Printer Alerts via iMessage

Is there a way to send an SMS via Applescript/Automator in either of these scenarios: When a low printer ink alert occurs ("Cyan is at or below 10%) With the periodic status of ink levels ...
1
vote
0answers
56 views

Save pdf from sender in Mail.app to folder with applescript

Trying to find out how to save email attachments like a pdf to a folder and can't figure out what I'm missing using the following. Any ideas? using terms from application "Mail" on perform mail ...
1
vote
0answers
16 views

Applescript claims to run shell script, but script has no effect [duplicate]

So I have a bash script like this: #!/bin/sh FILE='some_file.js' gsed -i -E 's/something/somethingelse/' "$FILE" echo "Modified File" When I run this from command line, it echoes the last line, so ...
2
votes
2answers
222 views

Mail Script Help

I forward a lot of emails to Evernote and Nozbe (similar to OmniFocus) as I work to get my inbox to zero. When I am on my iPhone, I move emails to folders (Evernote, Nozbe, or Archives) depending on ...
3
votes
1answer
77 views

Automator Service to insert text only available when text is selected

I'm trying to make an Automator Service to insert the current date. I have one that works but it is only available in the Services menu when text is selected. I need it to be available when there is ...
4
votes
1answer
63 views

Change font of Terminal programmatically w/o restarting

At home I've got a nice big display that unfortunately does not have the same resolution as my retina macbook does. I'd like to use a pixel-font on the low-res screen and a nice smooth one on the ...
1
vote
1answer
57 views

Control haptic engine and force touch from terminal

Is there any way that I can create haptic feedback with the integrated force touch trackpad on my rMBP using a terminal command (preferably without AppleScript, but if that's the only way, then ...
0
votes
1answer
26 views

Applescript: automated key press of spacebar/left click at defined intervals

I'm new to apple scripts and was wondering if there is a way the program the computer to press spacebar or left-click at defined times upon running of the script. For instance I will be able to same ...
1
vote
0answers
37 views

AD network drives and or apple script editor

I have a new Mac laptop. I have it on a Windows domain and I get my drive mapping in the sidebar when I login with my AD account. When I change my account to a mobile account I loose the mapping in ...
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
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 ...
0
votes
0answers
29 views

Change modified date in Finder for date added

I've been trying to do this for a while. For backup purposes, I'm looking for an applescript that replaces the modified date of folders and content (files and folders) with the date added. It would ...
0
votes
0answers
23 views

applescript to create keynote chart with floating point values

I am trying to create an applescript which can generate plots in Keynote. When I try this, it seems that any floating point values are being converted to integers. Here is a short applescript which ...
-2
votes
1answer
29 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
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 ...
5
votes
3answers
1k views

Copy message_id from selected message

In Mail, when I've selected a message, I would like to have a shortcut to copy the message_id (see my previous question) to the clipboard. How do I manage that? Applescript, I presume?
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 ...
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" ...
1
vote
2answers
70 views

How do I create an automator to forward mail?

My parents both have GMAIL accounts. We were wondering if there was a way to forward email so when my dad's account receives email from a certain sender it would be forwarded to my mom's account. ...
1
vote
3answers
76 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 ...
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
42 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 ...
2
votes
1answer
82 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 ...
0
votes
2answers
326 views

Applescript to Heart or Love or Favorite song

Anyone know if there's away to heart/love/favorite a song in the new iTunes via applescript? Basically I want the ability to heart a song from Apple Music without switching back to iTunes.
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 ...
2
votes
2answers
447 views

AppleScript keystroke ignoring numbers

A very simple AppleScript like this: tell application "System Events" keystroke "abc 123" end tell results in just “abc” being typed. Online resources suggest this should not be the case. ...
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 ...
5
votes
3answers
2k views

Why does this applescript not actually set the input volume to zero?

I have this command that builds a script to mute the input volume. The input volume is not fully muted, though. It seems to be closer to 10% than 0%. osacompile -x -e 'tell application "System ...
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 ...
1
vote
1answer
73 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 ...
1
vote
2answers
1k views

using automator/applescript to upload files to a web form?

I have a bunch of files I want to upload to web page. Unfortunately the web form for uploading only allows me to specify one at a time (it spawns and 'open file' dialog). Is there an easy way to do ...
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" ...