All Questions
Tagged with macos applescript
2,606 questions
1
vote
2
answers
89
views
Find bluetooth connected devices battery level through Apple Script
I'm making a swift app that shows the battery level of all connected bluetooth devices.
I've got three devices connected: Mysz(name surname), Magic Keyboard (name), i12; where Mysz is just Magic Mouse....
0
votes
0
answers
41
views
How can I open a Mail Attachment on macOS 15.5 Sequoia?
I am looking for a script to open the (pdf) attachment of a (new) eMail using Mail 16.0.
I tried this AppleScript and hoped it would open the attachment, but nothing happens:
tell application "...
0
votes
2
answers
58
views
Copy and rename a file with AppleScript without changing its extension
This applescript allows me to extract the text I'm interested in from a .gcode file but actually creates a copy of the file before modifying the original file. I would like to save the file without ...
0
votes
3
answers
71
views
Select all lines starting with ";" with Applescript
I'm trying to create an applescript that would allow me to clean up a .gcode file by removing all lines that don't begin with a semicolon ";"
Here's a small example of the gcode file:
; ...
0
votes
0
answers
40
views
Apple script looping gives invalid index
I have an fairly simple apple script. I get some random number of windows so I loop through all the windows to find the window I am looking for, then do some stuff on the window. The first three ...
0
votes
2
answers
83
views
AppleScript - open Screenshot app and start recording screen (Mac mini M4)
I need to record the screen using the Screenshot application. This script launches the Screenshot app, but it does not start recording:
tell application "Screenshot"
activate
end tell
...
0
votes
1
answer
46
views
AppleScript - open Screenshots app (Mac mini M4)
I need to open the Screenshots application using AppleScript. I have an Apple Mac mini M4.
My code does nothing. No error.
tell application "System Events"
keystroke "5" using {...
0
votes
1
answer
56
views
Adding multiple images and text to Pages via Applescript
I need to automate adding multiple images with title text to an Apple Pages document. My assumption is that I need to use AppleScript to do this.
So far I've tried things like the following:
tell ...
0
votes
1
answer
33
views
JQ not recognized by AppleScript
I have a daily journal I create in Devonthink3, and as part of the note creation, I add that day's weather and the forecast. I ran this fine for about 90 days, but had to wipe the computer and reload ...
1
vote
1
answer
51
views
AppleScript - Deleting selected files and folders whose filename contain a certain string
we work with template files (generally psds), all saved together in folders, that have a generic name.
We copy them and remove the ones not needed for the project, and mass rename the generic string, ...
0
votes
1
answer
82
views
Embedding AppleScript in Bash Script
I have a working AppleScript for pinning a given app the dock:
set theAppPath to "/Applications/Adobe Acrobat Reader.app"
try
set theShellScript to "defaults write com.apple.dock ...
1
vote
1
answer
58
views
Fetching contact's birthday in Apple Script
I am trying to fetch the birthday of a contact in the contacts list, on Mac.
tell application "Contacts"
set firstContact to first person
set contactName to name of firstContact
...
0
votes
1
answer
46
views
Generating new mail message with specified sender leaves wrong BCC recipient
I try to automate composing a mail with specified "to:" address, sender account and content including an attachment. I found the following AppleScript snippet I use from within a Bash script:...
0
votes
0
answers
34
views
Hot folder on file add copy to folder on shared drive with AppleScript
I am trying to write a script I can attach to any folder that when I copy or save an item into it, it will make a copy into a separate folder. Both of these folders exist on a NAS. This script seems ...
0
votes
0
answers
53
views
applescript - processing Chrome windows
I've written an AppleScript containing 2 parts:
part1 cycles through all Chrome windows and sets the given name - this works as expected
part 2 wraps tries to do a similar thing but processes windows ...