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

How can I factor out a long 'every radio button in every…' query in AppleScript?

I'm trying to press the 'Log in as yourself' radio button on the Screen Sharing app. I can achieve that with this: to clickAsYourself() tell application "System Events" to tell application process ...
1
vote
0answers
31 views

Why would a codesigned app suddenly start triggering “… not allowed assistive access.” error?

Environment: OS X 10.10.5 Background: I have an applescript I've been using for past year or so. I use it for copying a password from my password manager (1Password, in my case), and it then pastes ...
0
votes
1answer
91 views

Calling Python 3 script from AppleScript

I have a Python 3 script that I'd like to add as a Service using Automator. The idea is that I can right click on a text file, and an option will display to run my script on said file. The shebang ...
0
votes
1answer
51 views

change url of a tab using apple script

I am trying to set the url of Chrome tab using Apple Script. I am using this code. It successfully sets url string, but in order to change url, enter needs to be pressed. This last step makes my code ...
2
votes
0answers
12 views

Get current time with/in milliseconds from OS X command line [duplicate]

I'm trying to get the current time from OS X command line to work with in AppleScript to output the elapsed time. Currently I'm using this script: set timea to do shell script "date +%s" ##something ...
0
votes
1answer
22 views

Zip email with con AppleScript

I need to zip all email that have in the body this words "Identificativo messaggio: CA3DA789.008822A5.C33F80AE". I have many email in AppleMail so i think if it's possible to create an AppleScript ...
1
vote
1answer
32 views

Trying to wake my Mac using Apple / Power Manager Script triggered by Folder Actions

I've been trying to tweak the following script to achieve this. (original script) tell application "Power Manager Scripting" tell workshop set myEvent to make new event with properties {id:"...
3
votes
2answers
2k views

Double click in AppleScript

How do you write the command to carry out a double click with a mouse at a specific location in AppleScript?
0
votes
0answers
19 views

Applescript: Choosing Sound Output

I want an applescript which allows me to choose sound output. Using this link, I created the following applescript. set theSource to (choose from list {"A", "B"} with title "Sound Picker" default ...
5
votes
1answer
209 views

How to register AppleScript as default web browser in Yosemite?

This is essentially the same question as How to register an AppleScript as a potential default web browser?, but the solution there doesn't seem to work on Yosemite (LSIsAppleDefaultForScheme no ...
2
votes
2answers
12k views

AppleScript/Automate Mail Tasks

I've been trying to help a coworker automate a weekly email compilation he sends out but haven't yet been able to figure out how address a few specific areas...first I'll explain the situation, then ...
3
votes
1answer
45 views

Need my automator script to display the regular shutdown prompt before shutting down

I'm using the script below to trigger a shutdown but I would like it to give me the normal warning menu with the 60 sec. countdown, I can't figure out the warning menu. tell application "finder" to ...
3
votes
2answers
832 views

Changing trackpad scroll direction with AppleScript in Yosemite

I prefer "natural" scroll direction when using my MBAir trackpad, but "unnatural" when using the mouse. I frequently switch back and forth depending on where I'm working, so I've been using a bit of ...
0
votes
3answers
209 views

How to use Applescript to find duplicate files and .mp3 files in my iTunes “Music” folder and subfolders?

I recently moved my iTunes music library onto a new computer set-up by copying the "iTunes Media" folder onto an external HD and then onto my local disk. When I opened iTunes for the first time, it ...
3
votes
1answer
129 views

Problems reconnecting to WiFi if connection is lost

In the area where I live there are frequent power outages for a few seconds. I am connected via a router, which (of course) restarts each time. Unfortunately my Mac (2011 MB Pro) does not ...
0
votes
2answers
77 views

How to write a script that runs whenever a new file is added to a specific directory?

I've never written a script for OS X, and I don't really know which scripting tool i'll use for this task. Here's a pseudo code for the script I want to build : whenever a new file X is added to ...
2
votes
2answers
989 views

How to make Rsync copy alias files?

System specs: 2011 iMac, OS X Mountain Lion 10.8.4 I have come to understand that Rsync does not handle Mac Alises properly, and have now discovered that hundreds of aliases I've previously copied ...
1
vote
0answers
183 views

Curl terminal command syntax from Applescript

I want to execute a curl command in Applescript that does the following (per this SE question/answer): http://superuser.com/a/1054803/471181 ...Do an HTTP POST of the contents (as a string) of a ...
1
vote
0answers
25 views

Change Notification Style from Banner to Alert via AppleScript

does anybody know an easy way to make an apple script that changes the notification style for a specific app from "banners" to "alerts"? I've been trying for hours but I'm finding it hard to use the ...
0
votes
0answers
17 views

Apple Script for Mail Rule

Q regarding Apple Mail Version 9.2 (3112): Can Apple Script be written to open message(s) upon receipt in the “VIP” mailbox? I already have a rule that sends messages with a certain sender to the VIP ...
1
vote
1answer
112 views

Open the same terminal without switching spaces

I'm looking for an AppleScript (or anything, really) that will do the following: If a Terminal window is open in the current space, bring it to the front. If not, open a new one in the current space....
0
votes
0answers
24 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
64 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
38 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
33 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
37 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 Player"...
0
votes
1answer
49 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
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
8 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
58 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
48 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
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?
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
71 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
30 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 ...
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
1answer
30 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
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 ...
0
votes
1answer
48 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
2answers
458 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
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
31 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
15 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" ...
0
votes
0answers
51 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 '"...