Questions tagged [applescript]
AppleScript is a proprietary programming language in macOS to control and exchange data with applications.
3,138
questions
0
votes
0
answers
10
views
In Apple Mail.app: way to modify "Send" to prompt for either "Send" email or "Send and File Copy" of email to folder?
I have a DevonThink database where I store email correspondence relating to my casefiles. But I am always forgetting to file sent messages. Is there anyway to modify the "Send" function (or ...
0
votes
0
answers
10
views
Make AppleScript App Default Browser
I'm aiming for an incognito shell over Chrome (or Brave, idm) and so far the best answer is making an applescript. My motivation for this is switching to Alfred and wanting to make use of search ...
0
votes
0
answers
27
views
How to read text from clipboard with waiting list?
I ask you, please, if you could tell me how to read text from the clipboard with a waiting list?
I want to select text (which copies itself to the clipboard with the Auto Copy extension of the Chrome ...
0
votes
1
answer
26
views
Scripting with multiple sections but different result [closed]
trying to set up a script where a user can select multiple answers.
so prompt asks for example favorite colors and they choose from list "black, white, red, orange, blue".
the user selects ...
0
votes
1
answer
50
views
Mass Convert Numbers to CSV/Excel (Watch me do)
We have a department that has been using a copy of an Apple Numbers file to input daily data into and save them daily. The numbers file is designed with multiple tables etc. - but they have the same ...
0
votes
1
answer
37
views
Entering password through keystroke fails
I was automating password entry for an application using shortcuts,
First used shortcut action,
Open application_name
then wrote AppleScript,
on run
tell application "System Events"
...
0
votes
0
answers
18
views
Finder/ osascript asks for SMB login even though the unlocked login Keychain has them
I have a cron script which includes
osascript -e 'mount volume "'$smbVolumeUrl'"'
When the script runs, a Finder popup asks for my credentials for the mount volume. I enter them, and the ...
0
votes
0
answers
22
views
AppleScript enter a keystroke as soon as a window opens
I would like to enter a keystroke {return} as soon as a window opens.
Currently I set a delay for 20s and then keystroke {return}.
But the opening time of the application varies from 10-25 sec.
So I ...
0
votes
0
answers
16
views
Admin account sudo code asking for password in Applescript
I'm trying to create an Applescript that COMPLETELY removes the user from having to set up an admin account AND with full access to the disk (on macbooks/macbook pros). The newly created admin account ...
1
vote
1
answer
64
views
How to run "node index" from a folder in terminal
I've managed to open the terminal in the right folder using AppleScript. but I can't figure out how to make it run node index.
How the line of code looks so far:
do shell script "open -a '...
3
votes
1
answer
226
views
AppleScript for zipping folders does unexpected things
I compiled the following script to zip multiple folders with only their contents.
(So for instance, folder X containing files A, B and C will form a zip file containing A, B and C and not folder X as ...
0
votes
1
answer
25
views
How do I add leading zeroes to a batch rename Applescript?
AppleScript newb here. After hours and hours I cannot find how to add leading zeroes to this rename script, which renames a bunch of pngs and jpgs etc. to the parent folder's name.
Currently it ...
0
votes
1
answer
25
views
script menu keeps disappearing from menu bar
The script menu (and only the script menu) keeps disappearing from my menu bar (MacBook Air). It happens on my current Mojave, but has been happening through previous OS as well.
I know how to open ...
0
votes
1
answer
18
views
How can I stop Mac Automator using previous specification for my actions?
How can I stop Automator using previous specification for my actions?
I’m going crazy with Automator.
I have three folders : Deployed, Draft and Live.
In both folders there is a Public folder:
I want ...
2
votes
0
answers
21
views
AppleScript: get A's every item whose B is in {1, 2, 3, 4}
I'm pretty sure my question is just a general syntax question, but including specific context in case it's relevant:
There's a Mac app called SwitchResX which lets you do cool things like create and ...
0
votes
1
answer
32
views
Make any application into a global drop down application (Quake terminal style)
I like to use a global hotkey to show/hide a terminal window. Many terminals have added support for this (originally popularized by terminal in Quake).
I want to do this for other things, like a web ...
0
votes
0
answers
10
views
Using AppleScript to send email message; How do you set the background and font colors?
Using AppleScript to send email message; How do you set the background and font colors?
I have everything working but I can't set the background color??
The font color (is working)
set color of words ...
0
votes
0
answers
46
views
Shell Script to check password has been set to Immediately and what the screen saver time is set to
I need to create a script for checking a security posture of a machine using OPSWAT MetaAccess. They have a built-in check, however, according to them, they aren't able to check since macOS 10.13+. ...
0
votes
0
answers
41
views
Automate renaming a part of a filename from another folder for versioning purposes
I have psd files in a folder which i have to output multiple crops, the crops creation are automated to come extent but i need to make sure my versioning is the same.
Example Logic
Get contents of '...
0
votes
0
answers
30
views
Bioutil (Touch ID) shell script in shortcuts.app on MacOS don't work
I have a problem with bioutil function.
In Terminal, I am using two commands which are working:
sudo bioutil -ws -u 0 # disables TouchID for unlock
sudo bioutil -ws -u 1 # enables TouchID for ...
1
vote
1
answer
42
views
Bash script or AppleScript to connect & disconnect an Airplay display in Monterey+
In System Preferences > Displays, bottom left corner is "Add Display". I can choose another (Monterey+) Mac, Apple TV, iPad, possibly other things, to effectively become an additional ...
1
vote
2
answers
68
views
What is '<<EOS' in shell commands like 'osascript <<EOS'
In this post and one or two others I've seen things like:
osascript <<EOS
-- some AppleScript code
EOS
I expect it's part of bash and presumably other shells... or is it an AppleScript/...
0
votes
1
answer
45
views
Disable TimeMachine with AppleScript and Automator on Monterey?
I was using an App created with Automator to quikly disable and enable Time Machine backups on my Mac with just one click. I was using a command that for some reason seems to doesn't work since I ...
0
votes
0
answers
54
views
AppleScript to guess notes app password
I accidentally set a password on my notes app and I have no idea what it could be. I was hoping to write some code to just brute force guess at it using AppleScript.
I really don’t have a ton of ...
0
votes
1
answer
52
views
Shell script error 127
I am not knowledgeable about shell scripting, but I'm using a command for merging files together, which works great on my computer, but when I move it to someone else's computer, it generates error ...
0
votes
1
answer
25
views
Cron job is python script not executing automatically altough cron and Terminal was added to full disk access
I set up a cron job for writing every minute from a python script an entry into a log file which is created from the python script.
The python script is working fine if I execute it manually but it ...
0
votes
0
answers
15
views
Copy all events from one calendar to another calendar, but keeping the UID and NOT overwriting changes?
I want to copy all events from calendar A to calendar B once on hour or so, while keeping the UID of an event and also not overwrite changes made to an event in B.
I have looked into Apple Scripting ...
1
vote
0
answers
34
views
Batch Change Created Date using Automator and CSV File
I have 1,500-some Facebook photos all showing with the same date as they come from a data download.
Through the magic of regular expressions, I have generated a CSV file where each row has the ...
0
votes
0
answers
34
views
Applescript to delete old promotional emails
I have a Gmail account that I use for signing up for websites that I expect to get spam and promotional emails from. I want to keep receiving promotional emails in case I want to use a promotion. ...
0
votes
0
answers
23
views
How to confirm alert box of specific terminal window id?
I am starting a new terminal window from a terminal:
osascript -e 'tell app "Terminal" to do script "myProgram.sh"'
Since the new process is not ending(it is basically a server), I ...
0
votes
0
answers
30
views
Is it possible to write a script to tap the X on the Mac touchbar Display Connected prompt
There is this prompt on the mac touch bar that says "Display Connected: Mirror Displays / Extend Desktop" with a little X on the left hand corner. This prompt pops up every time I wake my ...
0
votes
0
answers
14
views
Folder Action runs for no reason
I have the on adding folder items to event handler attached to my ~/Desktop folder. It works for what it does but, annoyingly, it also runs when I simply open my Desktop folder (i.e. press Cmd-Shift-D)...
1
vote
1
answer
35
views
Terminal open page 5 of PDF in Preview
I am trying to automate the task of using Preview to open a PDF to a certain page number. How can I do this in the terminal or using AppleScript?
0
votes
1
answer
47
views
How to select a tab/window with AppleScript
I am trying the fullscreen just one of several Preview tabs with AppleScript by fn + F how can I select the tab by its name?
tell application "Preview" to activate
delay 0.1
tell application ...
0
votes
0
answers
31
views
How to choose multiple folders and open them AppleScript
I made a script to open a folder on an online volume and I wanted it to ask how can I choose multiple folders while the prompt is open and then open them all. Every time I do that I get this error:
...
0
votes
0
answers
30
views
Apple Script to change the keyboard between 2 languages of 3
There are 3 keyboard languages installed in the system: Spanish, ABC and Arabic.
How do I make:
A Space+Cmd hotkey that would switch between Spanish and ABC only.
A Space+Opt hotkey that would turn ...
2
votes
1
answer
68
views
How to close Preview tab with terminal / AppleScript?
Suppose my Preview app currently has 3 tabs named A B C open. Now from terminal I wish to close tab C.
A comment suggest AppleScript is able to accomplish this task, could someone provide a working ...
2
votes
1
answer
46
views
Delete Files with Apple Script
My photo camera allows to save pictures in RAW and JPG in parallel. I find this convenient because on my Mac I can quickly browse the JPGs and delete the "bad" ones. Besides, I keep the RAW ...
0
votes
1
answer
22
views
Can't use System Events when using Launch Daemons and Agents
I'm writing a little Go program that uses osascript (based on mac2mqtt):
func getCommandOutput(name string, arg ...string) string {
var outbuf, errbuf strings.Builder // or bytes.Buffer
cmd := ...
0
votes
1
answer
37
views
Save output from a command to a file after the command is executed
I executed the command and it took quite a long time; now it is necessary to work with this output, but I realized it too late. Executing the command again is not a good idea.
I know that can select ...
1
vote
0
answers
61
views
How can I trigger AppleScript whenever the Deskop-workspace is changed?
I am an avid user of the Mission Control Desktop Workspaces feature of Mac OS. But keeping track of which space I'm in, and even moreso what the previous space was, is frequently a problem.
There are ...
0
votes
0
answers
35
views
Can't use Applescript Ui scripting to click 3rd-party menu bar item
Looks like my question may be a dup of this question from 2017, but I am posting as it seems to be unanswered.
I am trying to automate switching sound outputs in a menu bar app called SpeakerAmp. The ...
0
votes
0
answers
27
views
How do I run a subsequent script if the text entry field is not focused?
I am currently using the first script which is valid if I have my cursor selected in the text field.
tell application "System Events"
tell application process "Capture One 20&...
0
votes
1
answer
32
views
The action “Find Finder Items” encountered an error: “Unable to search with Spotlight.”
EDIT: Ok I give up using Automator actions, probably it has something to do with my external drive being ExFat not indexed or something. If anyone has an AppleScript code or whatever workaround to ...
0
votes
0
answers
61
views
Open finder directory in terminal emulator of choice?
I'm using a launcher app called Raycast which lets me run script commands anywhere. On their github I found community Applescripts that have functionality I want (opening current finder folder), but ...
0
votes
0
answers
24
views
Automator questions - Copying files to new location [duplicate]
So I have some questions about the Automator.
I'm doing a fairly simple task with it and that's why it boggles my mind that it doesn't work. Always brings me the same info
"The action "...
3
votes
1
answer
79
views
In Finder, how dynamically change folder icon's color when said folder contains .git folder?
Looking for an automated way, in macOS Finder, to change a folder icon from its default blue to green, based on whether or not it contains a .git repository.
Can this be scripted or automated with a ...
0
votes
0
answers
29
views
How do I use AppleScript to capture screenshot and make it float on the desktop above everything else?
This functionality was offered by Snappy Mac app but the new OS updates have broken the functionality and I'm looking to implement my own version.
0
votes
0
answers
9
views
Message a number using Services - Automator
When I highlight a number and right-click on it, I want to be able to access the Messages app to text that specific number. I have tried many different ways but none has worked.
Not sure what ...
0
votes
0
answers
28
views
AppleScript "Open Notification Center" works in Script Editor but not as an App
I am trying to let go of Mojave and move on, but I use the dashboard constantly, and the only thing I think that could make it possible is setting up the middle mouse button to toggle open/close the ...