Questions tagged [applescript]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
25 views

Add Finder Sidebar Section via Terminal

Is it possible to add a new section to the Finder sidebar? I'm interested in adding a new section to the Finder sidebar, and auto-populating it as part of some personal automation. I understand that ...
1
vote
2answers
204 views

Issues with Mail.app AppleScript scripts

I'm trying to get a simple AppleScript to run from a rule in Mail.app under Catalina. The script is very basic: use AppleScript version "2.4" -- Yosemite (10.10) or later use scripting additions ...
11
votes
6answers
7k views

Change display arrangement in OS X/macOS programmatically

I periodically have to move my display around (physically1) and this requires also rearranging my display arrangement in System Preferences. Manually doing this all the time is a pain in the neck. ...
1
vote
1answer
36 views

Applescript to Unmount Volumes Matching a Pattern

I have several backup offline and bootable backup volumes on a disk , and I would like to unmount all of them at startup. They all start with the name "Backup" I've found the following Applescript ...
1
vote
1answer
34 views

Can I run a script in the background? (Apple script editor)

I have a script on apple script editor for a discord bot. (Discord is a chatting app my friends and I use) The discord bot is called "Dank Memer" and basically there are coins that you can get by ...
0
votes
1answer
188 views

AppleScript error: “Finder got an error: Network file permission error.”

I have an automator script that I use to create an empty file in finder and I've been using it with no problem for about a year. All of a sudden, it's giving me this error: The action “Run ...
1
vote
1answer
59 views

How to find the application that controls system dialog window

I am trying to change the default browser between Chrome and Safari without needing user input except for initially running it. I found this utility that takes care of the difficult bit: https://...
3
votes
2answers
45 views

Apple script - formatted text to strikethrough but how do I also change its colour? - In Notes

I have an Automator Quick Action routine that changes the font of selected text to Strikethrough. Is it possible to also change the colour of the selected text to Blue please? on run {input, ...
0
votes
0answers
11 views

Applescript to batch convert Screenwriter documents to PDF

I'd be grateful for some help as I don't know what I'm doing. I have zero AppleScript knowledge and I'm really struggling. I am archiving old screenplays written in Movie Magic Screenwriter, (https://...
7
votes
6answers
4k 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 ...
2
votes
1answer
22 views

Trying to access Safari developer tools prints “Access not allowed (-1723)”

I am trying to create a script which lists me all available open simulators to inspect in safari developer tools but when I run the code I get the below error. At the end this script should open the ...
2
votes
1answer
234 views

Adding login items from terminal in Catalina

I've tried multiple ways but none work. A few AppleScripts and even some bash script somebody made. Which essentially just executes a different AppleScript afaik. Some of the commands I have tried: ...
3
votes
4answers
867 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 ...
0
votes
0answers
13 views

How to make an automator app prompt to ask to be granted Accessibility permission

I wrote an AppleScript (saved as an app) to automate a repetitive task*. It's much faster than me doing everything manually. Since I've been working from home, I copied the app to my laptop, and ...
2
votes
2answers
834 views

Automatically open a terminal window and run a command, robustly

I am looking for a way to automatically open a new window of Terminal.app and run a command in it. I used to do this with AppleScript, in a way similar to this: tell application "Terminal" do ...
2
votes
0answers
58 views

Applescript editor camera access

I'am trying to use imagesnap inside applescript but when I run my script in editor it hangs. If i run imagesnap in terminal it does the job. Here is the code : do shell script "/usr/local/bin/...
1
vote
2answers
278 views

Changing AppleScript-created date-based folder structure

I have an AppleScript that has been written and it works as such, but I need to change the way it creates the folder structure. The script does the following: Folder is selected which contains files (...
1
vote
2answers
78 views

Print multiple email messages from Apple Mail to individual PDFs

My goal is to be able to highlight a number of messages in Apple Mail then run a process to print them each to a PDF. Right now I can select multiple emails command + P Then select PDF -> Save as PDF ...
1
vote
1answer
467 views

How to run Excel on headless Mac?

I'd like to run applescript to control Excel on a headless Mac. I want to do it from the command line via ssh, and I cannot - there is no display to run applescript on, so osascript throws an error. ...
1
vote
1answer
135 views

How to create Automator workflow to paste in authentication code within a GUI app?

I currently have created an automator workflow (in Catalina) that will paste in a two-step authentication code by a keyboard shortcut within the Cyberduck app. However, I am wondering how to possibly ...
-1
votes
2answers
57 views

How do I add a custom app icon for AppleScript app?

I have my own AppleScript app. How would I add a custom App icon to it? EDIT: The only solution that has worked for me is pasting the image into the existing icon in Finder.
7
votes
2answers
22k views

Converting HTML to PDF using convert utility in Mac OS X

I'm trying to convert a bunch of HTML files into PDF files. I'm looking for an automated solution so that i don't have to open each HTML file individually and convert it to PDF. In Mac OSX, convert ...
0
votes
2answers
53 views

Open a file that I double-click with app created with Script Editor

I created an Application from Script Editor with this content: do shell script "PATH=/Library/TeX/texbin:$PATH ¬ open -n /Applications/Xournal++.app" and I called it /Users/enzotib/Applications/...
0
votes
0answers
28 views

How to find out the albums contained in folders a photo is in

I need to find in which album some photos are contained. I've already tried with a script the script below without success. As the albums are contained inside folders the script doesn't seem to be ...
0
votes
1answer
35 views

try to run 'exiftool' from applescript but get 'command not found' [duplicate]

this is my first attempt to run a shell script, namely 'exiftool', from applescript: set cmd to "exiftool -" & tag & "='" & myName & "' " & myFile do shell script cmd cmd ...
0
votes
0answers
39 views

Unable to Add “Where from” Metadata with Special Characters Using Applescript

Trying to add the "Where from" metadata in the Finder's "Get info" section of a picture on the Desktop and I am not able to since the text has special characters. In this case, it is "?" and "=" ...
2
votes
1answer
49 views

How to create a list with checkboxes in Automator?

How difficult is it to create in Automator (either AppleScript or Javascript) something like this? I would like to have a groceries list. And only the selected items to be copied in clipboard line ...
1
vote
1answer
33 views

Automator Eject Action - OSStatus error -36

Hopefully quick question: I've made an automator quick action to eject all BUT the disks that are always hanging around my computer. It uses an AppleScript to get the list of disks, strip it of the ...
62
votes
2answers
30k views

How do I find out the applescript commands available for a particular app?

I'm trying to find out if I can get iTunes to do something complex, but don't know what can be scripted. Is there a way to find out what applescript commands an app will respond to?
0
votes
0answers
31 views

How to Exploit Accessibility for Automation

Context I have an application (let's call it App.app) that I'd like to automate using JXA. It doesn't show up in Script Editor's Dictionary. I guess that means that it does not expose an api to ...
1
vote
0answers
35 views

Using Automator, Applescript & FFMPEG with If/Else Statements

I'm just not finding the resources I need. Perhaps someone can point me in the right direction and delete this post afterward. I'm working on making an Applet that is more complex than the one I have ...
0
votes
0answers
14 views

Invoke media keys from a script

I’m trying to control the Mac’s media keys (play/pause, at least) from JXA (AppleScript for Automation). I understand those keys can’t be simulated via System Events, but maybe it’s possible to ...
0
votes
1answer
22 views

Auto run a shell script when connecting to a network? (wifi or utp)

Is there a way to make macOS run a custom script whenever it (re)connects to any WiFi or Ethernet network? Basically, whenever my macbook connects to any network (wired or wireless) I would like to ...
1
vote
1answer
218 views

Use Apple Script to open Chrome with specific profile

I use multiple instances of the Chrome browser for different profiles, each with their own google account. I'm trying to automate a task using Applescript and Automator, and have set up Automator to ...
2
votes
3answers
1k views

How do I invoke a service using Applescript?

I'm using Circus Ponies NoteBook which doesn't support Applescript methods. It does support creating services that can clip the current selection into a NoteBook page. This allows me to select text ...
0
votes
0answers
71 views

Applescript outlook - get meeting times, date from outlook meeting invite

I want to monitor my outlook inbox and if I get a new meeting invite email, create a copy of the invite with same title, date, time and forward to another email. So I want to retrieve the subject, ...
1
vote
2answers
60 views

How do I convert this Applescript to Terminal osascript?

I'm trying to convert this AppleScript into osascript format that can be run from terminal: tell application "System Preferences" to activate tell application "System Preferences" reveal anchor "...
1
vote
2answers
72 views

Get AppleScript's “do shell script” to use the latest Bash

For some reason, I cannot get AppleScript's "do shell script" to use the latest (GPLv3) Bash: do shell script "/usr/local/bin/bash; echo $BASH_VERSION" -- Result: "3.2.57(1)-release" Strangely, it ...
3
votes
2answers
1k views

Get first item in list using AppleScript

How do I get the first item from a list into a variable? I'm trying to get the first window of an application's windows. I tried tell application "System Events" repeat with theProcess in ...
-1
votes
1answer
353 views

AppleScript: start/stop QuickTime Player screen recording on timer

I would like to use an AppleScript which will tell QuickTime Player to start screen recording immediately and stop screen recording after a specified length of time (e.g. 60 mins). In my search so ...
0
votes
3answers
57 views

Script iTunes to prepend Season and Episode number (padded) to episode title

I'm not knowledgeable about scripting, so I'll be upfront about that. I've been doing management with Doug's Scripts for over a decade, but the one that would be most useful (Append to Selected Tag) ...
1
vote
2answers
342 views

AppleScript to find and delete a folder inside an FCPX library

I need to write or find a simple script to find, select and move to trash, folders within a Final Cut Pro X library. Because these libraries are bundles you can't search them in the normal way. What ...
0
votes
1answer
39 views

Automator service works everywhere except when using keyboard shortcut

My automator service is as follows: Workflow receives no input in Google Chrome.app Input is entire selection (checkbox not checked) Run Applescript on run {input, parameters} tell ...
0
votes
0answers
24 views

How can I set what computer uses the secondary monitor with a script?

I have two computers, an iMac 27" and a MacBook Pro, both running Mojave and a Thunderbolt 27" display. Both computers are linked to the external monitor through a thunderbolt cable. I primarily use ...
0
votes
4answers
80 views

Opening Randomized Images From Multiple Folders With Preview Application

Basically what I am trying to achieve is the following: Create an alias list of any amount of folders with the Finder's selection. Get all images from those folders with a shell script. Randomize ...
2
votes
2answers
1k views

Using POSIX path to attach a file to email in AppleScript

I am attempting to send an email via the standard Apple Mail application using a POSIX file reference on macOS Sierra (10.12.3). Everything builds fine, but when it sends, the attachment is not being ...
0
votes
1answer
40 views

How can I write a script that opens a notification?

Is there an apple script that can click on the notification for me so that I don't have to open the app using a mouse? I plan to bind this script to a keyboard shortcut and that way I can open ...
4
votes
1answer
588 views

PowerPoint Macro for Mac - load pictures like “Insert Photo Album”

PowerPoint on the Mac doesn't have the Insert Photo Album functionality which allows you to select images and new PPT created with one image on each slide. I have an old macro that does this on ...
0
votes
0answers
21 views

Why doesn't my screen turn off with this automator service?

I have created an automator task to run a screen to turn my screens off, using the keyboard shortcuts section in the System Preferences I able to map this to a keyboard shortcut. My automator script ...
0
votes
0answers
14 views

trying to move emails not addressed to me to subfolder using AppleScript in Outlook

I have all these emails that are not directly addressed to me but to groups I am a part of. They're annoying and means I find it difficult to notice emails actually addressed to me. I have tried the ...

1 2
3
4 5
55