Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [applescript]

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

0
votes
0answers
11 views

Dual Applescripts

I'm trying to figure out how to have two apple scripts run simultaneously by clicking on the one icon. Currently I'm trying to use set contentFile to myFolder & "Contents/Resources/Secondary....
0
votes
0answers
13 views

loginwindow high CPU usage

I have simple zsh script which executes the following code at a regular interval. spotify_track=`osascript -e 'tell application "Spotify" to name of current track as string'`; This is causes ...
1
vote
2answers
48 views

Opening a local .mp3 file with AppleScript Editor

So I have been trying to create an AppleScript application that when I click on it, it opens a mp3 file within the packages contents and resources. This is the only code I have within the script: set ...
0
votes
0answers
9 views

Invoking AppleScript from Mail Rule

While working on an AppleScript to save message attachments from a mail rule I believe I have come across what appears to be a limitation. It seems that if you invoke an AppleScript from a mail rule ...
1
vote
1answer
32 views

Getting file path of latest added file in a folder - Mac OS 10.9

As learned from google and sister stack sites, this is the working solution I've come up with for getting the path of latest added file in a folder. But this is not giving the accurate result. I'm ...
1
vote
1answer
35 views

macOS: Trigger a script when a second monitor is attached

I am on macOS El Captain (upgrading to High Sierra soon) and I'm looking for a tool which can trigger an AppleScript or shell script when the number of monitors/displays attached to the system changes....
0
votes
0answers
18 views

Automator workflow: Find Finder item, prompt user for text, append said text to file name

There's lots of information online for batch renaming files using Automator, but I can't figure out how to prompt the user for text and then append this inputted text into the file name. I see the '...
0
votes
0answers
8 views

Want to write AppleScript that will Open URL from Certain Emails and Fill Out and Submit a Form [on hold]

I receive regular work emails that contain a unique URL that requires me to: open the url fill in the same information each time and click a submit button. I want to automate this process by writing ...
0
votes
1answer
22 views

How to open a URL with Terminal through applescript by using mpg123?

I need to use mac terminal to open an audio stream from a URL through an applescript. I know that mac terminal is already equipped with afplay, but that only plays a file which is available on your ...
1
vote
2answers
38 views

An apple script for google dictionary pronunciation

The following is the link to Goole dictionary pronunciation files: http://ssl.gstatic.com/dictionary/static/sounds/20160317/pronunciation--_us_1.mp3 If you substitute "pronunciation" with your own ...
2
votes
0answers
18 views

“Cannot open” when saving combined videos in QuickTime Player

I have several hundred videos that are each divided into ten 2-minute segments, so I am running an AppleScript to combine these with QuickTime Player 10.4. The way it works is by pasting all the parts ...
1
vote
1answer
44 views

Applescript to drop down Script Editor in Menu Bar

I want to write a script that will drop down the menu of the script editor from the menu bar, but without selecting a menu item from it. The idea is to give the script a keystroke shortcut (like F15) ...
0
votes
0answers
23 views

Detecting a Floating Menu in Touch Bar with AppleScript

I'm trying to write a simple script using AppleScript that can identify and close a floating menu on the touch bar. An example, for clarity: Suppose that I've opened the Spotify floating menu on the ...
2
votes
1answer
59 views

AppleScript: complex script for WIFI login, getting time and launch screensaver

Experts! I'm new to apple script and struggling with its complexity...But maybe someone can help. The thing I want to do my iMac: The iMac is used to work as a HighEnd slideshow for an artist work. ...
0
votes
0answers
22 views

AppleScript UI for Notability

Okay, using a program called "Notability" for taking notes now. I would like to create a shortcut for changing text colors, etc. However, I'm having trouble scripting the UI. The changing colors is ...
0
votes
0answers
21 views

Applescript to turn HDDs off during day, and back on at night

I figure I should ask my first question, I'm curious to see how an Applescript could control my HDD that my TimeMachine is backed-up on to un-mount during the day, and back on before the scheduled ...
0
votes
0answers
25 views

Is there a way to change the color of rows in Finder corresponding to a folder when the folder is selected?

I sometimes find it difficult to tell visually what folder a deeply-nested file is in. For example, take a look at this screenshot. It can be hard to tell that emailTemplate.html is at the path ...
1
vote
1answer
37 views

Applescript : Click at position not working

I'm trying to click on a Chrome extension ( Google Highlight : https://chrome.google.com/webstore/detail/multi-highlight/pfgfgjlejbbpfmcfjhdmikihihddeeji) then click on the text box and past my ...
1
vote
0answers
29 views

Using Applescript to execute Javascript in Chrome and set a value to a variable

I'm building a service through Automator. So I'm trying to execute this bit of Javascript in Chrome and set the clipboard to the value of one of the variables. Essentially it is grabbing the contents ...
0
votes
0answers
32 views

security command, creating keychain entry, not working in Mojave

I have been using an Applescript with the following line to create username/password in keychain for the past 3 years: security add-internet-password -a lawprint\\Lawschool -l '2nd-flr-Library-...
-1
votes
0answers
40 views

Building an Applescript to get user input, and automatically fill out website to download a file

I'm very new to AppleScript, so please forgive me if this seems like amateur hour. Here is what I want to do with my script. I want to collect user input via a dialog box, so they can search a ...
0
votes
2answers
45 views

How to validate user input as integer, then confirm that integer is a specific length using Apple Script

I'm building an Apple Script to prompt and receive input from a user via a dialog box. The default answer of the dialog is "Enter Code". The required input is a 6-digit code given to each user. On ...
2
votes
1answer
84 views

How can I trigger an Applecript or Automator app when a specific bluetooth device comes into range?

I have an Applescript that connects a bluetooth speaker to my Mac and switches “Play sound effects through:” to “Internal Speakers”. I want this script to run every time I turn on my bluetooth ...
0
votes
0answers
30 views

Add currently playing song to Apple Music using AppleScript Editor

I am trying to make an AppleScript that automatically adds the current track that I am listening to on Apple Music to my library. What I have done so far is set the option "Add songs to Library when ...
1
vote
1answer
16 views

What does errAEWrongNumberArgs error mean running AppleScript?

I copied a script that I found online, but it will not run. The error I receive is Logical operator NOT used with other than 1 term (errAEWrongNumberArgs:-1721) Here is the script. on run {input, ...
0
votes
1answer
36 views

AppleScript to get contents of file in Apple Mail

I am attempting to make an auto replier bot. The bot will respond differently (and perform different actions) based on the message that is received. Instead of emailing the bot, I will be texting the ...
1
vote
0answers
18 views

Toggle Light Mode/Dark Mode AND Accent Color from one to another

I am new to scripting, so excuse my lack of knowledge. I would like to create a toggle that switches from Light Mode and an accent (and highlight) color of blue to Dark Mode and an accent/highlight ...
1
vote
0answers
19 views

Applescript automatically replaces text look up to rich text causing errors

Trying to extract a substring in applescript and the last line here is giving me trouble: set repTo to the reply to of theMessage set startStr to offset of "@" in repTo set endStr to ...
1
vote
2answers
42 views

AppleScript / Automator to sort files based on filename

I want to select a folder of QuickTime movies and copy each one into separate sub folders depending on the filename (by copying not moving). I have a folder that I want to contain sub folders called ...
3
votes
1answer
44 views

Embedding AppleScript inside a Bash — getting Error

I'm fiddling with bash for the first time and trying to get something simple to work. #!/bin/bash while true ; do osascript <<EOF tell application "System Events" ...
1
vote
2answers
42 views

AppleScript - Error: Expect End of Line found end of script

I'm an AppleScript novice and receiving the above error in what should be a very simple AppleScript. I believe it is somewhere in the set statement but unable to ascertain. Would greatly appreciate ...
3
votes
0answers
61 views

Bash script detect received iMessage along with its contents?

I've been doing some searching around online for an answer to this question and can't seem to find one. My aim is to run a bash script which waits for the arrival of an iMessage from a specific ...
0
votes
2answers
43 views

How do I transcribe an AppleScript?

I found an AppleScript example on a website that I want to use, and the example is rendered as text in the browser (vs., say, being a suitably formatted file to download). To use this AppleScript, I'...
0
votes
1answer
37 views

Dynamically loading an Automator action based on a filename

I would like to create an Automator action that will load an external Automator action based on a portion of a filename, on folder drag. For example: Filename[Type1].xxx Filename[Type2].xxx ...
0
votes
0answers
45 views

How can I get an image selection programmatically?

I need to log the bounding box of the selected area from an image to the command line. This is because I will have to do this across a number of images and then compare and reuse those bounding boxes....
2
votes
1answer
53 views

AppleScript to find files by exact name match from an Automator variable

I have a workflow that gets the track name of a single track in my mp3 player and stores it in a variable. I then use this in the Spotlight action to find that track in my iTunes Library, but the ...
0
votes
0answers
18 views

Problems with AppleScript for Mail to replicate Sweep function of Outlook

I recently got wonderful help here writing an AppleScript for Mail. My goal is to process incoming messages like this: if the incoming message is from a designated sender, move that message to a ...
0
votes
0answers
10 views

Create iCloud calendar using AppleScript

So I'm trying to create an iCloud calendar using AppleScript but I can't figure out how to select the account correctly. Here's my script: tell application "Calendar" create calendar with name "...
0
votes
1answer
23 views

Automator: Combine PDF pages double or triple in size

I have the following workflow: https://drive.google.com/file/d/1EhuddCrCrmwRfJPe9M0QoamWwNm9U_Nm/view?usp=sharing Here's the desired outcome: I select a file, it splits it and I rebuild it as smaller ...
1
vote
2answers
55 views

How can you active the Script Menu Bar with AppleScript?

In AppleScript if you want to show the Script Menu in the menu bar you have to: Click Applications Scroll down and click Utilities Click Script Editor (this was called AppleScript Editor in older OS ...
2
votes
1answer
45 views

Use copied file path in terminal (from applescript and automator)

I'm trying to create a simple workflow that will be used to help non-technical people use tesseract OCR. I have no problem using it myself, but others probably prefer GUIs, so I'm working on the ...
0
votes
1answer
89 views

AppleScript to Option-click on the Dropbox Menu Bar Icon

I have an AppleScript that does a simple "mouse" click on the Dropbox menu bar icon (Menu Extra or Menulet). It works well. tell application "System Events" tell UI element "Dropbox" tell menu ...
0
votes
1answer
13 views

Applescript : Lock & UnLock MacOS based on device stats

I'm trying to do a script to lock my computer when a USB key is not connected and the other way , unlock my computer when the USB is connected. I'm not quite sure how to do the second part, should I ...
0
votes
0answers
20 views

iTunes & Radio Section with AppleScript

I have an HomePod and I want to listen Radio in iTunes on morning. So far it's not possible to set an alarm using a playlist or a radio in the HomePod settings. So I decided to use iTunes on my Mac ...
0
votes
1answer
49 views

Run an AppleScript daily with launchd

I'm trying to run an AppleScript which ejects all drives (from the excellent answer by Monomeeth here) daily at 8 am using launchd. After some searching, I decided the best way to do this was by using ...
1
vote
0answers
44 views

AppleScript handle QuickLook on itself?

I've created a very simple AppleScript app which currently, when run, displays a different image from the desktop depending on which day of the week it is as seen below: set currentDay to weekday of (...
2
votes
1answer
46 views

Automator to get PDF Annotations and export to Excel

I'm trying to make a macOS service using Automator to extract PDF annotations and get the information into an Excel file. I can successfully get the annotations from a PDF, and export them to a text ...
1
vote
0answers
22 views

Setting alarm on iCal with Applescript does not work with iCloud calendars

This script, which adds an event to the Calendar, works with the calendars that are local to the Mac that it runs on. When used with iCloud calendars, it seems that the alert is set for a few seconds ...
2
votes
1answer
30 views

Open file in Sublime Text tab via AppleScript

Using the following AppleScript code, I can open a .txt file in a new window of Sublime Text: tell application "Sublime Text" open "Users:me:Desktop:foo.txt" end tell Is there a way to open this ...
1
vote
3answers
63 views

Help writing AppleScript with Mail rule to keep most recent

I've created a rule to move mail from specified senders to a new mailbox called "News." I'd like my AppleScript to go through the "News" folder and only keep the most recent emaisa from those senders,...