Questions tagged [applescript]
AppleScript is a proprietary programming language in macOS to control and exchange data with applications.
3,406
questions
0
votes
1
answer
47
views
Script to open Safari > Preferences > Websites > Notifications
I do not believe that macOS PPPC on Ventura and higher will permit this, but:
Is there a way to use AppleScript (osascript) to open Safari's Preferences window and change focus to Websites > ...
0
votes
1
answer
160
views
Can an Automator workflow generate an Application?
I'm building a "Wizard" of sorts that uses Automator and some Appliescript, and at the end I would like it to generate an "Automator Application" that does things when launched, ...
0
votes
0
answers
8
views
Google Chrome does not have permissions to "see" dialog boxes
I am a huge fan of automating my workflow with Keyboard Maestro, a kind of uber macro tool that can run script steps, execute Applescript or Javascript, save variables and do lots of other stuff.
I ...
0
votes
1
answer
119
views
Create a playlist via command line?
I have some rather complicated scripts that I use to create MP3 files which I use for improving my language skills. Each session creates a new file in each of six languages, with text embedded in the ...
2
votes
2
answers
2k
views
AppleScript - Click coordinates stopped working
I use a web-based program that lacks batch actions. This creates the need for repetitive clicking. I wrote a script on Apple's Script Editor that took care of that, it is very simple and worked ...
1
vote
1
answer
58
views
Can Automator be used to visit/upload/save images from a website?
I have a folder on desktop with png images.
I'd like the images to be sent to a website (Vectoriser.ai).
Uploaded one image at a time (multi drop is not available) and save the result to another ...
0
votes
0
answers
25
views
How to automate a macOS Finder Extension with AppleScript or Automator?
I am trying to improve a photo processing AppleScript I've already written. I have a set of files in a folder I'd like to send to an app, DXO PureRaw. I currently do this in with:
open newFolderPath ...
1
vote
1
answer
453
views
How to run AppleScript from Keynote?
Within Keynote and using AppleScript, I’m trying to emulate a macro used in a Windows PowerPoint file by a colleague. The macro is executed by clicking on a customized button. So, I wonder if the same ...
1
vote
1
answer
257
views
How to resize multiple photos (batch) in Apple Photos app on macOS
Having 1 TB of photos and videos in Photos.app, one might want to resize some old photos or even videos so that the changes are perfectly (keeping all metadata) updated in the Photos.app and the ...
0
votes
1
answer
102
views
Would it be possible to have a script obtain Apple ID details of an iPhone via a Mac or pc?
I use a previously used iPhone with an Apple ID signed in, I’m no longer able to contact the owner.
I wish to know if it’s possible to extract the Apple ID of an iPhone via command scripts on a Mac or ...
2
votes
3
answers
768
views
Apple Script to close all windows in Finder — but keep active window AND ITS TABS open?
I would like to close all Finder windows but keep the active one open – included keeping all its tabs open also. AppleScript are from Mars and it seems I’m from Venus, but
I’ve found some ready made ...
2
votes
1
answer
200
views
Applescript permissions in Mac OS 12
My music licensing business uses Filemaker and quite a few Applescripts as part of its day to day operations. For years we have been running everything on OS 10.14 without any issues. We recently ...
0
votes
0
answers
28
views
ISL Light macOS remote connection via SSH
I am trying to establish a new tunnel on ISL Light app from ISL Online. I have an account already and on when I log in, in the Computers window I can access a remote server that I am assigned to have ...
1
vote
1
answer
382
views
Modify "Show on all Spaces" wallpaper setting by shell on macos Sonoma
In system settings, under Wallpaper, there is a new toggle option to "Show on all Spaces". I'm looking for a way to set this option via shell in terminal since when a new wallpaper is set ...
0
votes
0
answers
25
views
Integrate FileMerge.app into Finder using the Automator application to create a service
I was trying to adapt the accepted answer to this question. How to integrate FileMerge.app into Finder?
I'm on a mac with macOS Sonoma version 14.1.1. Unfortunately I get the following error message.
...
0
votes
1
answer
174
views
Run AppleScript when notification is receieved
I have a script that runs perfectly but I want it to initialise when I receive a notification with the title "Bricks + Agent". Even better if I can actually put the subtitle text into the ...
0
votes
1
answer
227
views
How do I retrieve a list of all my songs on the iPhone?
I have a large collection of mp3 files that I want to listen to on my iPhone. I do not have an Apple Music subscription.
I have used iTunes on Windows to add a subset of my songs to its library and ...
1
vote
1
answer
383
views
Automator application script not working when scheduled from "not on the screen" user
I have an Automator script (app) that simply does few clicks in an app. This script is launched via a calendar event. The script is scheduled and run from a different admin account than the account ...
2
votes
2
answers
1k
views
How to switch the keyboard input language from the terminal?
I already have one way to do this:
function input-switch-darwin() {
cliclick kd:ctrl kp:space ku:ctrl
}
But this is very slow:
❯ time cliclick kd:ctrl kp:space ku:ctrl
cliclick kd:ctrl kp:space ...
1
vote
1
answer
87
views
Launch DMG drive script failing after restart
I have an automation (screenshots of it here: https://www.icloud.com/iclouddrive/0bB-1AiIWdJc1jmkfdjRbsAVA#Launch_Plex_Media_Automation_ )saved as an app in Automator with the following AppleScripts ...
1
vote
0
answers
35
views
osascript keystroke character case with VMware web console
Looking to get the ability to simulating typing a password into a vm console. Figured osascript and keystroke should be the answer.
If I run the following I get what I believe to be the correct ...
0
votes
2
answers
113
views
Putting an image into the clipboard via stdin
I know I can take image content from the clipboard and pipe into STDOUT like this:
osascript -e "get the clipboard as «class PNGf»" | sed "s/«data PNGf//; s/»//" | xxd -r -p
Is ...
1
vote
1
answer
149
views
System events script sometimes works, sometimes doesn't
This is a part of a bigger script that I isolated and have an issue with:
tell application "Google Chrome" to activate
delay 2
tell application "System Events"
click ¬
...
0
votes
1
answer
120
views
Trying to execute shell commands opening multiple terminals
I have a shell command which I use to setup multiple servers (metro, laravel, ngrok). Each of these processes needs to be executed in its own Terminal window. The issue right now is that all I'm able ...
2
votes
3
answers
2k
views
Fixing "not allowed to send keystrokes" error in Automator workflow
MacOS Ventura 13.3 but I have had some form of this problem on and off for a couple years.
I have a simple workflow that types the current date in ISO 8601 format, it is a single AppleScript action ...
1
vote
0
answers
41
views
Reveal app window from command line?
I'm trying to bring back up a minimized mpv window using a keyboard shortcut.
I use skhd to map keyboard shortcuts to various open commands, so I can quickly launch frequently used apps. This has the ...
2
votes
1
answer
308
views
Open the most recently closed Finder location (tab or window) with a keyboard shortcut
In Finder, I can reopen a tab or window I just accidentally closed by going into the Go > Recent Folders menu and pick one of the recent folders from the list.
I'd like to open it with shortcut ⌘ ⇧...
32
votes
15
answers
73k
views
How to retrieve current wattage info on OS X?
Is there a way to retrieve the current watt usage info on OS X Snow Leopard? I'm using mid-2010 iMac, so I'm not looking for just battery-related apps.
Does OS X even monitor power usage? Do I need to ...
1
vote
2
answers
116
views
Need AppleScript to ignore extra line in TAB input file
I'm trying to read in a tab delimited file that was exported from Filemaker Pro. Filemaker adds an extra return or line feed at the end of every export. I can't get my AppleScript to ignore this extra ...
1
vote
1
answer
191
views
Shortcut to toggle Bluetooth in Montery via blueutil shell script executed with AppleScript in BetterTouchTool
I have set the Mission Control key in BetterTouchTool to execute an AppleScript and it worked fine before the update from Mojave to Montery which I just did
do shell script "../bluetoggle.sh"...
2
votes
1
answer
110
views
Mac Mail - Set signature by sending address
I use macOS's Mail app and have iCloud+. I have two mail addresses - my usual iCloud address and another through a custom domain that I own, that maps back to the iCloud account (something which is ...
3
votes
1
answer
103
views
How to send an email with AppleScript, without the text being put in a blockquote
I am trying to use AppleScript to automate sending mails through AppleMail, but the message always ends up being send as a blockquote (i.e. as if I replied to an email and my message got quoted).
Is ...
26
votes
5
answers
45k
views
How to know the name of UI elements using Accessibility inspector (or any other tool)
I'm trying to interact with a print dialog via Applescript.
What I want to emulate is the user setting a value on a specific dropdown.
Say I have:
tell application "System Events"
tell process "...
0
votes
0
answers
20
views
How to add automator scripts to apple shortcuts?
I am trying to run a simple automation I recorded via Automator app, that will open my AirPlay devices and start screen mirroring to my TV (named as TV).
I was able to record functional automation, ...
0
votes
1
answer
1k
views
Use Automator to move files to new folder based on list of filenames?
I'm not sure if this is something that Automator can do, and would really appreciate any pointers.
I'm working with a folder of ~4500 images. Based on some metadata that I have from another source, I ...
0
votes
0
answers
75
views
macOS Terminal Command to Disable Desktop Widgets?
Looking to find a way to use a terminal command to disable/enable desktop widgets in macOS Sonoma. The closest I have been able to find so far is a script that does this. However, I would like to do ...
2
votes
1
answer
76
views
Unable to rename file in applescript
I feel my AppleScript skills are sorely lacking and hope to learn from this effort.
I have code working that will process one or more files dropped on my app. The processing takes an ".mp4" ...
0
votes
1
answer
217
views
How to adjust Apple Music's application volume from a Shortcut/with AppleScript?
I'd like to write a Shortcut ("Fade out Apple Music") that slowly reduces the Apple Music volume over the course of ~5 seconds.
I don't see a Shortcut option for getting/setting Apple Music'...
0
votes
0
answers
36
views
Apple Script to refresh safari at intervals and then to run key codes at interval
I'm trying to incorporate following tasks.
Refresh Safari every minute
After every refresh, press the down and right arrow at specific intervals.
My Attempt
I rattempted the following code but it's ...
1
vote
1
answer
88
views
Switching to the first tab in Mail using Applescript or Shell
I am looking for a way to switch to the first tab in a Mail window. It seems like there is no universal way to address tabs in macOS programmatically. I have tried Apple scripting with and without ...
0
votes
1
answer
472
views
Attach unique attachment to email using apple script to send email to different users
I'm new to apple script:
Does anyone have an example of using an AppleScript to send individual emails with unique attachments for each email using an excel list? (Lots of examples out there sending ...
0
votes
0
answers
18
views
Relocate menu bar item with applescript?
Suppose that I want to move a menu bar item to the right. Then I do command + drag and drop.
Now, is there a way to do it with applescript? In particular, this is useful when some icons on the bar ...
0
votes
1
answer
27
views
How to tell Applescript to call a Fondation's class's init?
A subquestion could be: how to find the AppleScript name of a class's instances?
Context: I use the following to access NSTimeZone variables and apply methods.
use scripting additions -- essential to ...
0
votes
1
answer
32
views
How can I use applescript to target an embedded sidebar button in a menu bar application?
I can access a menu bar application via applescript doing something like:
tell application "System Events" to tell process "NordVPN" to ¬
tell menu bar item 1 of menu bar 2
...
1
vote
1
answer
534
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 ...
2
votes
1
answer
221
views
AppleScript : CMD + S
I can't manage to keystroke Command + S on an app, it's seems to trigger "Save AS" instead of "Save"
tell application "TextMate 2"
activate
tell application "System Events"
...
2
votes
1
answer
2k
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
1
answer
299
views
Using Apple Shortcuts app output
I must be missing something with Apple Shortcuts.
Once you have a result, how can you get it written in the application you're using if it's not an application in Shortcuts catalogue ?
Let's say for ...
2
votes
1
answer
966
views
Automount afp Volume with AppleScript
I know this is similar to other open questions about mounting network drives, but this one is slightly different.
I have an AppleScript that runs at startup that looks like this:
tell Application "...
0
votes
1
answer
368
views
osascript gets "System Events got an error: osascript is not allowed assistive access. (-1728)"
I have a modest (~250 lines) python3 script using tkinter and subprocesses.
The python script launches a macOS app using the "run" subprocess.
Python defined functions then query the system ...