Questions tagged [applescript]

AppleScript is a proprietary programming language in macOS to control and exchange data with applications.

286 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
243 views

Hot keys forcing Siri to open twice

About 30% of the time when pressing Command + Space for a fraction of a second too long, it causes Siri to close and open again. This delays the process a significant amount that at times its required ...
2
votes
0answers
178 views

Global shortcut for menu item within menubar bar application

I'd like to create a applescript that selects the "History" menu item from the menubar application Jing. I'm aware of how to create a global shortcut for an application with multiple menus, but I'm ...
2
votes
0answers
376 views

Executing “Copy Dropbox Link” with a script

I want to create a script that executes the command from the contextual (control-click) menu, "Copy Dropbox Link". How can I access this command with Applescript (or any other Mac scripting service)? ...
2
votes
0answers
230 views

'Add notes' to a Calendar event using Automator

I would like to build a 'Service' for selected text which: Get the currently selected text Creates an Calendar event adds the selected text as a 'note' for that Calendar event I prefer Automator for ...
2
votes
0answers
936 views

Apple Script to Apply Rules in Mail.app

I've created some rules in my Mail.app to change background color of specific messages And also I've created rules in the mail server to move specific messages to some folder For messages in the ...
2
votes
0answers
33 views

How to fix «event coreslct» error?

I have an AppleScript source with this code: tell "Microsoft Word" «event coreslct» (last row of table X of document Y) insert rows selection position below number of rows Z end tell After ...
2
votes
0answers
148 views

The process of making custom notifications, iOS GarageBand, iTunes database, iTunes file format, AppleScript

I'm developing an iOS and Android app which uses custom notification sounds to provide users with step-by-step instructions. I've recently stepped through a pretty messy process of creating these ...
2
votes
0answers
529 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"...
2
votes
0answers
46 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 ...
2
votes
0answers
81 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%, ...
2
votes
0answers
131 views

Automating VPN switching

I can us a VPN app like tunnelbear to appear to be in other countries, but is there a way to do this in a bash script or applescript? I want to be able to run automated tests on my iOS apps (in the ...
2
votes
0answers
472 views

automatically share photos to Photos iCloud Shared Albums

I'd like to script the Yosemite Photos app so that every time I place images to a folder on my desktop, it automatically is imported into the Photos app and uploaded to a shared album. Is this ...
2
votes
0answers
428 views

How to detect if chrome (or any other app) is playing sound using bash/applescript

I am writing a script to turn off audio on my mac, but need to check if its coming from the browser or an app (say Spotify). Is there a way to detect which app is playing sound?
2
votes
0answers
788 views

Start QuickTime and set camera to iPhone from command line

I'm attempting to start QuickTime from AppleScript and select the camera of my iPhone like I do from QuickTime. I can't seem to make it change the camera. The script I have now is: tell application "...
2
votes
0answers
639 views

batch convert iWork 08 files to new version on Yosemite

TL;DR Short version: I have a bunch of files that were created with iWork 08. Is there a way, maybe using AppleScript or Automator, to convert them to the new format (Pages 5.5, Numbers 3.5) without ...
2
votes
0answers
157 views

How do I make an applescript launch as soon as it exits screen saver

I would like my mac to to say 'Login Authorized' as soon as I exit screen saver mode. Where should I place the script? Thank you in advance!
2
votes
0answers
864 views

Tell application “Microsoft Outlook” not working after Yosemite upgrade

I have two Macs. The AppleScript code below runs on one Mac ("Mac 1"), but not on the other ("Mac 2"). Mac 1 is running Snow Leopard, where Mac 2 was upgraded to Yosemite, and the AppleScript below ...
2
votes
0answers
286 views

Export image from clipboard to folder

I create a lot of mockups for my mobile phone. I recently heard of the brilliant idea to just put your current mockup as an image into your Dropbox (or whatever cloud your using). Then just take your ...
2
votes
0answers
2k views

Applescript, OS X : How to Get a list of phone numbers from Contacts, and send an iMessage with Messages App? Halfway there I think..?

I am trying to create an applescript that will grab all of the labeled phone numbers of 'mobile' and 'iPhone' from the every contact in Contacts App (specifically the phone numbers from the iCloud ...
2
votes
0answers
2k views

Applescript / Automator - Pass variables between them

I have a question about how to pass the applescript input from one computer to another computer's automator input (I created it as a program). I've created the script below to ask for the filename and ...
2
votes
0answers
89 views

Click in finder vs “open -a” on command line

I have a file type (.mxl -- compressed MusicXML) which if I double click in Finder opens properly in my .mxl reader (Finale 2014.app) but which if I call "open file.mxl" or "open -a /Applications/...
2
votes
0answers
58 views

Applescript Editor's compiler erratic behaviour

I've just come across some bizarre behaviour in the Applescript Editor (Snow Leopard - 10.6.8) that I was wondering if anyone knows how to get around it. Basically, one second a statement will ...
2
votes
0answers
411 views

AppleScript for enabling VPN broken after update to 10.9.3

I've been using an AppleScript for connecting to my office VPN. After updating my macbook to 10.9.3, it fails to execute, and throws an exception Unable to get network preferences (honestly, it is ...
2
votes
0answers
662 views

Get iTerm session by tty name

I want to run a command within an iTerm2 session like this: tell application "iTerm" tell session id "/dev/ttys020" exec command "ls" end end But I get the following error (with and without '...
2
votes
0answers
112 views

Run rake using Automator

I have install ruby using RVM. Next I create workflow in Automator, which detects new files in folder and then copies them to another dir. The next thing I want - to switch to those folder and run few ...
2
votes
0answers
69 views

Sort Stickies by desktop

I have OS X Lion 10.7.5 with four desktops and also have 4 groups of stickies (one group per desktop). Every time that I have to reopen the Stickies app, they are unsorted (all stickies open on the ...
2
votes
0answers
674 views

AppleScript to find old mail messages is slow in ScriptEditor

So I have an AppleScript that iterates over all the messages in various mailboxes and finds messages which meet various criteria and moves them to Deleted Items. The mailboxes in question are ...
2
votes
0answers
180 views

AppleScript deployment conventions?

I haven't seen a package-management system for AppleScripts, but it seems like the foundations for one are present. Given: Scripts (and folder) located in the ~/Library/Scripts/Applications folder ...
2
votes
0answers
975 views

Progress Indicator for AppleScript

Okay, so I have an AppleScript that is really just a wrapper for a simple shell script, so I could turn it into a double-click to run application, droplet and URI handler on OS X. Anyway, this works ...
2
votes
0answers
786 views

With Lion, Problems Accessing Shared NTFS Folders with SMB://

We are testing a local login script that we created for our Macintosh users on Lion. It has worked fine on all OS X versions prior to 10.7. Listed below is the script that we are using. When we run ...
2
votes
1answer
145 views

Applescript - Contacts: Why can I get addresses and emails from a contact but not phones

Errors when getting phones In Script Editor, if I run: tell application "Contacts" to get the vcard of person 301 the result is: "BEGIN:VCARD VERSION:3.0 PRODID:-//Apple Inc.//Mac OS X 10.13.6//EN ...
2
votes
1answer
343 views

How to bring an application to the front, no bouncing dock icons

In my AppleScript, I use activate to bring an application to the front. However, on machines of some colleagues, it doesn't do that. The app-icon in the dock will bounce, but it doesn't get put into ...
1
vote
0answers
43 views

Apple Script with Terminal Commands

I'm trying to create an application that would automate a couple of Terminal commands. I need the application to open once I drop a file on top of it, run the commands, and close. The sequence of ...
1
vote
0answers
35 views

Applescript to set terminal window to specific size

I found this question Is it possible to define the width/height of a Terminal window with this command: osascript -e \'tell application "Terminal" to do script and tried setting my ...
1
vote
0answers
32 views

Default Volume Slider in Quicktime Movie Recording

Is there any way to change the default volume for a Quicktime movie recording? If always defaults to 0 (muted) when starting a new movie recording. I understand that this is done in order to prevent ...
1
vote
0answers
30 views

How to execute a PKG file using a custom universal keyboard shortcut?

It may sound strange but I need to run a specific PKG installer whenever I trigger a specific custom keyboard shortcut. On Sierra 12.6 I've assigned a custom keyboard shortcut to sleep/lock-screen the ...
1
vote
0answers
37 views

Replace font in incoming mail [mail.app]

I'm trying to write an Applescript (my first) to change the font of incoming emails using a rule in Mail.App. In particular, some tasteless individuals use Comic Sans, and I want to change their ...
1
vote
0answers
27 views

Help with Apple Script for dealing with duplicates in Numbers

I had a script that I used to find duplicates in a numbers document and to highlight the duplicate in red. Well I now have a file where there are multiples of the descriptor in column B that are ...
1
vote
0answers
25 views

AppleScript : to do Javascript action in Safari repeatedly

I created this script to highlight some data points in Safari. This was working fine but I had to restart the script often as shorting the data in a different order remove all the highlight ... I ...
1
vote
0answers
47 views

Place html data on the macOS clipboard via applescript

I want to use applescript to place HTML data onto the clipboard from a text variable. I have at present a line of code that invokes applescript via the command line from my applescript. set toUnixSet ...
1
vote
0answers
25 views

AppleScript : two class with same name

I'm getting some text from Safari in a column. I used to use this script to add all text from this column in a list : PS the class is class="sortable null" tell application "Safari Technology ...
1
vote
0answers
62 views

applescript- script works when used in Script Editor but does nothing when saved as standalone app

Don't judge, my first code lol. How do I fix the stated issue and suggestions for improvement would be great. I just tried making something to pause music when I started a video and start playing ...
1
vote
0answers
20 views

Strange AppleScript behaviour in relation to Reminders

I am trying to write a small script that will move all reminders from one list to another. After some experimentation, I have come up with this, that seems to do what I want: tell application "...
1
vote
0answers
28 views

Can AppleScript select text after my cursor between designated characters?

I would like an AppleScript to start from my current cursor location (or the end of the current selection if there is one), scan forward to the next ";" or "(", then select all text until before the ...
1
vote
0answers
46 views

How to log the search history in Mac Dictionary when using the pop-up dictionary mode

how to log the search history in mac dictionary The answer to this post provides an AppleScript to record the words that have been looked up by actually opening the Dictionary app (using an assigned ...
1
vote
0answers
208 views

Running a command with access to “System Events.app” granted

I am updating applications installed via Homebrew from command line. iTerm2 requires access to "System Events.app" to be correctly updated, which ends up in a process that is not fully automated and ...
1
vote
0answers
34 views

AppleScript : cleaning text

Is there a way to remove some occurrence of a variable within a text without knowing where the variable is in the text ? e.g : IP= DA, null, var to be removed from the text : ", null," I ...
1
vote
0answers
21 views

Add fileserver to favorites in Finder, preferably scripted

I'm splitting my main office network into different segments with each their own subnet. This will cause our file-server (which will be moved to a different network than the users) to not appear under ...
1
vote
0answers
106 views

PowerPoint's save as PDF in AppleScript results in print job

I have a small AppleScript to save a PowerPoint pptx file as PDF from command line. I use the script every 6 months, and last autumn it still worked. But today I run into problems. I updated to 10.14 ...
1
vote
0answers
39 views

Keyboard shortcuts for non-menued items Preview?

I am trying to create a keyboard shortcut action for Preview, namely Draw and Sketch. However, they are are the NON-menued items, which means can't get it done in System Preference I see someone done ...