Questions tagged [applescript]

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

429 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
70 views

Use Google speech to text instead of Apple's

Google currently has much higher quality speech transcription. You can try it easily by going to doc.new and pressing Cmd-Shift-S and talking. Compare to using the built in system from Apple (pressing ...
0
votes
1answer
124 views

How to move/hover mouse (not click) over a button on Safari by using Applescript

Can anybody tell me how to write an Applescript that can move or hover mouse over a Button on Safari? I've successfully made an Applescript that can click to the button but I don't know how to make ...
0
votes
0answers
12 views

How to get contents of most recent iMessage

I would like to get the contents of my most recent iMessage using either applescript of terminal. I'm fine with it going to the clipboard or a variable, but I can't find this information anywhere. ...
0
votes
0answers
20 views

Automating sorting process for files in a folder based on same prefixes in their filenames

Okay, I have a directory that is the output directory for generated screenshots for a media player I use on a macbook (OS X High Sierra). I take a multitude of screenshots to review video files and I ...
0
votes
0answers
55 views

Run an AppleScript remotely from another Mac or iOS device

I have an AppleScript on my Mac (which controls VLC and Airfoil to play internet radio through some Airplay devices) and I want to be able to run the script by doing a simple action, i.e. one or two ...
0
votes
1answer
39 views

Applescript voice control

I'm trying to create an app to toggle voice control on and off, as for some reason Catalina removed the link between dictation and voice control thus ridding itself of the ability to use a keyboard ...
0
votes
0answers
199 views

Using appleScript for remote auto login to macOS

I'd like to be able to log in my computer through Apple Remote Desktop (SSH) by running a script while the remote computer is running the loginWindow. An ideal script would automate the process of ...
0
votes
0answers
33 views

Applescript on Catalina

Total scripting novice here, appreciate any insight. Have a few scripts that automate button presses in a specific application, triggered by Function keys. Worked well before Catalina, now when ...
0
votes
0answers
6 views

View Homekit Sensor in Toolbar

I have some sensors that I would like to be able to glance at to see their values in the toolbar on my Mac. Is there a program or an API to let me do this?
0
votes
0answers
176 views

Send keys to app in background / send keys to other app without losing focus of current app

How can I make some automated service type something in a non-focussed application without making that other application the frontmost? I found a StackOverflow answer which suggests using AppleScript:...
0
votes
1answer
54 views

AppleScript : do JS on different Safari windows

I'm using some script which basically get text from safari, click button and fill up textfield. e.g : tell application "Safari" set texttograb to do JavaScript "document.getElementsByClassName('...
0
votes
0answers
127 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 ...
0
votes
1answer
439 views

Allow ssh-keygen-wrapper to access “System Events” for all users in the same computer

When I run my AppleScript in a remote mode, I get this message in an user where the script runs: “sshd-keygen-wrapper“ wants access to control “System Events“. Allowing control will provide access to ...
0
votes
0answers
16 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://...
0
votes
0answers
21 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 ...
0
votes
0answers
29 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
0answers
45 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 "=" ...
0
votes
0answers
46 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 ...
0
votes
0answers
27 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
0answers
212 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, ...
0
votes
0answers
27 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
0answers
24 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
17 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 ...
0
votes
0answers
55 views

Automator or Apple Script to compress 3 folders?

I have 3 folders I want to compress to an archive and put that archive in a specific location. I'm running in to a few different issues depending on how I tackle the problem. All 3 files live in ~/...
0
votes
0answers
18 views

Automator Application: Retrieve --args passed by “open”

I am trying to create a simple application using the Automator that is supposed to open a given file in vim in a new iTerm window or tab (if a window already exists). So far the application consists ...
0
votes
0answers
130 views

“Grant File Access” dialog in Word 2016+AppleScript when inserting a picture

Please Help!! I have been using FMP to insert images into a word document by using apple script. This has been working fine until today (recent word update occurred and the likely culprit). When the ...
0
votes
0answers
141 views

Applescript - how to control multiple instances of the same application

I have 2 instances of the same application (e.g. Firefox, Chrome, Spotify, etc) and I'm trying to control one specific instance by PID or other methods via Applescript and the app specific methods. E....
0
votes
0answers
17 views

Trying to tell ITunes to play the highlighted artist using Applescript

To elaborate I'm trying to simulate me pressing enter on this situation: To play the songs of the highlighted artist, but in a non-focused iTunes (so while I'm on another app). I tried telling iTunes ...
0
votes
0answers
114 views

How do I ask the user for an integer in AppleScript?

I would like to ask the user for an integer input using AppleScript but I am unable to find how to do that. When I use set userInput to display dialogue "Please enter a number." default answer "" with ...
0
votes
0answers
249 views

How can I use AppleScript to set Night Shift?

I have setup an AppleScript that tries to change the state of Night Shift: https://gist.github.com/HanSooloo/0c1223e9efecf26d3110fc1f22913cff PROBLEM STATEMENT: However, I am getting an "Invalid ...
0
votes
0answers
87 views

How to insert image into Numbers with AppleScript

I'm trying to create an AppleScript that will: find the value of cell "x" tell application "Numbers" to ¬ tell table 1 of sheet 1 of document 1 set theimagename to value of cell "A8" ...
0
votes
0answers
17 views

Use osascript to send a “global shortcut”

I am using this wonderful application named NoiseBuddy which allows to turn on/off Airpod Pros noise cancelling with a global shortcut. In my case I assigned the shortcut to ctrl+1 and it works fine. ...
0
votes
0answers
53 views

macOS Screen Saver From The Finder's Selection Via Applescript

I will like to be able to set and start the macOS screensaver via the Finder's selection using Applescript. I will also like to be able to choose which screen saver pattern will be displayed. For ...
0
votes
0answers
39 views

Include an image and format text in the content of a Microsoft Outlook email generated using Applescript

I am using Applescript to automate an email and would like to include an image in the content of the email (not as an attachment, needs to be in the content). I would also like to format the text (...
0
votes
0answers
27 views

Why is this PDF rescaling Automator script misfires?

I am using an Automator to convert folders of A4-sized PDFs to other formats. It uses PDF GhostScript though I have not personally written the code, somebody on discussions.apple.com helped me at the ...
0
votes
0answers
26 views

How to get list of event attendees with JXA?

The Apple Documentation shows how to add an attendee to an event. var app = Application.currentApplication() var Calendar = Application("Calendar") var projectCalendars = Calendar.calendars.whose({...
0
votes
0answers
26 views

Apple Script: keydown doesn't affect game

I'm trying to use keydown to press a key in an emulator and a game however it is not being picked up. However, notepad does pick up the keypress. My Code: osascript -e 'tell application "System ...
0
votes
0answers
29 views

Change presentation settings in Apple Music by AppleScript

I want to enable the display of the last listening of a music piece (in French, «Dernière lecture») : When I write the following: tell application "Music" activate end tell tell ...
0
votes
0answers
47 views

Can I use Applescript in Automator to remember/recall variables and folder locations?

I am a total noob when it comes to using Automator (so late to the party), but I'm trying to create an app that imports, renames, resizes, and duplicates images. I've already created a workflow that ...
0
votes
0answers
173 views

Trying to open plist file to read ShadowHashData but keep getting an error (“the domain/default pair… does not exist”)

I am trying to run a command to try and look at a plist file on my computer, so I type this into terminal: cd /Volumes/"Macintosh HD" and then sudo defaults read /var/db/dslocal/nodes/Default/users/...
0
votes
0answers
87 views

Applescript alias is not updating after renaming a folder

I am still learning Applescript, but I am trying to script some automation for me. I am trying to get it to create a folder based on user input and then create a sub-folder with contents duplicated ...
0
votes
0answers
21 views

Late at night with inverted colors on, dynamic background is inverted as well, how to stop it?

I'm having the Catalina background in dynamic setting. I feel it really helps me to have a background that shows night and day on my laptop. However, now that I'm experimenting with working late at ...
0
votes
0answers
95 views

Apple Script “on idle” only works once with desired speed

I try to use Apple Script to get Keynote directly into presentation mode, and quit when the presentation stops. As one (of many) approaches I tried a Script saved as stay open application: on idle ...
0
votes
0answers
126 views

Requiring user input in order to run a script which controls Safari

Using Script Editor, I've created the following script to close tabs and open a particular window: tell application "Safari" repeat with i from (count of windows) to 1 by -1 repeat with j ...
0
votes
0answers
14 views

Get artwork of song Apple Music

I can't seem to be able to get the artwork data of my currently playing songs... tell application "Music" if running then set songArt to data in artwork end if end tell This should ...
0
votes
0answers
76 views

AppleScript - Repeat While with Return

My goal is to run a script continuously for 10 seconds, returning the result while the script runs. Right now when I run the script below the script stops after returning the result. If I remove the ...
0
votes
0answers
49 views

Applescript (Adobe Illustrator) find coincident X coordinate on a path for any given Y coordinate

I have two lines as shown in the screenshot below (Adobe Illustrator file) which my script produces. Is there any way, using AppleScript, to find the value of X for the coincident points on the ...
0
votes
0answers
136 views

Running “do script” synchronously in AppleScript

I have the following AppleScript that I run on login: on run {input, parameters} tell application "Terminal" do script ".../MyScript.sh" end tell return input end run I run ...
0
votes
0answers
54 views

How do I continuously check the status of a process and execute something once the process stops with an Apple Script?

I'm using an Apple Script to open an application and transcode a file. What I need to be able to do is continuously check the CPU usage of the process and when the CPU usage hits 0 I need to do ...
0
votes
0answers
155 views

Applescript to send email messages to the ALL EMAILS of persons with specific in interest

I am trying to write a script that filters the persons in the Contacts application whose note include a specific keyword and sending those who has at least one e-mail address an e-mail (to all their ...

1
5 6
7
8 9