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

Applescript. Create new, separate variables in a repeat loop

So I've made a script and at one point in it, it does this. set x to 0 repeat numberOfFiles times set x to x + 1 set {Frame, x} to {destination,x} as text end repeat What I ...
1
vote
1answer
31 views

Applescript code to find path to Desktop picture in Desktop 2

I need an applescript that will find the path to the desktop picture used in Desktop 2. As this isn't the current desktop the code below doesn't work. tell application "Finder" set DesktopPath to ...
0
votes
0answers
37 views

Applescript, CSV, Text to Speech

I've now a script which reads a comma separated CSV-file with two columns, one for language 1 words and another for language 2 words. The script makes from each word an aiff-audiofile which is spoken ...
1
vote
1answer
29 views

How to get an applescript to play a song file

Okay so I want an applescript app that plays a song. The song isn't already on the computer and it's contained inside contents/resources of the app's package contents. This is my current code tell ...
1
vote
0answers
23 views

How to get the fps of a video from QuickTime Player's inspector using applescript

I need a quick and easy way to find the frame rate of a video in applescript. So far grabbing it through QuickTime Player's inspector seems like the easiest option. tell application "QuickTime ...
0
votes
1answer
29 views

Getting the First Cell NOT Containing Certain Text in Numbers

I have a table in Numbers, and I'm trying to get the value of the first cell that contains the character …. In order to do so, I wanted to use MATCH(), but had no luck after I realized it could only ...
4
votes
5answers
2k views

Show text using Large Type without relying on third-party applications

Apple has this amazing feature called 'Large Type', chiefly implemented into Address Book. When you look up a contact, you can right-click the phone number and click 'Large Type', and it will display ...
1
vote
1answer
38 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
7 views

Calendar id which doesn't change

I am trying to write some scripts for calendar on Mac. I learned that the uid changes as the calendar event is moved from one day to another. Is there way to recognize the same event uniquely even ...
2
votes
2answers
52 views

Can Someone Explain Why These Scripts Work?

I'm a brand new AppleScript initiate. I was at a Developer Summit and needed to stop messing with my windows so much. So I looked up scripting the window sizing and positioning. I was on my MacBook ...
1
vote
1answer
31 views

Hide a Fluid app toolbar using applescript

I've been trying to hide the toolbar from a Fluid app application using applescript, but it doesn't seems to be working at all. I've also tried on Safari (fluid apps are built on top of safari web ...
0
votes
0answers
16 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?
8
votes
2answers
1k views

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

The Script Editor (formerly AppleScript Editor pre-Yosemite 10.10) saves .scpt files as binary files, not plain text files. It makes working with them in source code control systems somewhat ...
0
votes
0answers
39 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 ...
1
vote
1answer
28 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 ...
1
vote
1answer
31 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
27 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
23 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
32 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
31 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
420 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
41 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
21 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
25 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
12 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
17 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
39 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
40 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 ...
7
votes
7answers
8k 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
38 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
51 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
220 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
66 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
57 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
49 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
23 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
34 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
40 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
25 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
21 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
27 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
33 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
21 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
64 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. ...