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

How to send an email to myself with Applescript or Terminal automatically when my Mac reboots?

I wonder if there is a way to send an email to myself with Command Line or AppleScript service automatically when my Mac reboots? Thanks for your suggestions.
0
votes
0answers
18 views

How to generate pdf with MS WORD 2011 from Command line?

Is there a way to call MS Word 2011 from the command line to generate pdf from DOCX or PPTX?
1
vote
1answer
52 views

How do I script the forced logging out another desktop user from OS X?

We're running tests that require multiple desktops on a Mac Mini. We're successfully using an ssh TCP tunnel to localhost, 5900 to 6900, to make Screen Sharing let us log into other users on this ...
0
votes
0answers
73 views

Remove All Illegal Characters from All Filenames in a Given Folder and subfolders

I Know this was was basically answered on the net and using automator with the shell script (Sanitize Filenames) works great, but I need it to also do all subfolders as well. And if possible trim the ...
2
votes
1answer
42 views

Problems creating OS X installer with AppleScript

I’m trying to create a bootable OS X Installer (Including Mavericks, Yosemite and El Capitan) on an external disk with AppleScript. But now I have some trouble. Here is the code: display dialog "...
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
0answers
40 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 ...
1
vote
1answer
32 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 ...
0
votes
1answer
49 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
49 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
0answers
24 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
32 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
16 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 Checker</bitbar....
1
vote
0answers
19 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" ...
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
53 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
56 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 anything....
1
vote
0answers
67 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 ...
4
votes
1answer
72 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 ...
3
votes
1answer
95 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 ...
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 ("Cyan=10%,...
0
votes
1answer
37 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
40 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
1answer
70 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 sure.)?...
0
votes
0answers
38 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
31 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 ...
0
votes
1answer
56 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
27 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
37 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
53 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
51 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
19 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
84 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
26 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
39 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
33 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
57 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
43 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
83 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
27 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
31 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
60 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
51 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 ...