Questions tagged [applescript]
AppleScript is a proprietary programming language in macOS to control and exchange data with applications.
3,430
questions
1
vote
1
answer
33
views
Can't get shell script with filename $1 variable to work in automator
defaults write '$1/Contents/info.plist' MyVariable false
For some reason, I cannot get this to work, and I've tried everything I can think of.
Even through an AppleScript, instead of a shell script, ...
-1
votes
0
answers
23
views
Apple script setup [duplicate]
When I played Sol's RNG (a Roblox game) I wanted an apple script that automatically spams the key F. I also want a hotkey that starts/stops the script.
0
votes
0
answers
9
views
Get changes made to single instances of repeating events
I'm trying to access the events in Calendar.app from AppleScript. It seems I can't retrieve any information about instances of repeating events that have been changed. When reading all events of a ...
0
votes
1
answer
21
views
Run Applescript by default in log mode
From AppleScript, I can run another AppleScript with
set myScript to alias ((path to scripts folder as text) & "testScript.scpt")
run script myScript
I can also show the log window, to ...
4
votes
1
answer
53
views
Regex does not work properly with chinese characters on applescript
I'm trying to make a script that parse current folder into usable parts, following by pattern (\d\d\d\.\d+.\d+) - (.*)(\(.*)\) in python, which captures 3 groups {date, name, person} (date is in ...
1
vote
1
answer
30
views
Simple applescript to copy files from SD Card?
I'm sure this is simple enough to most, but I am just starting to play around with Apple script.
I simply want to have a destination folder highlighted in finder and run a script that will copy all my ...
0
votes
0
answers
9
views
AppleScript (Music.app) error: Can't get duration of current track
I have a simple AppleScript for starting a random video on a random position in Music.app as Automator application and as a startup login item. In the half of cases I get an error:
The action "...
0
votes
1
answer
43
views
How to make this script successfully trigger at a certain time?
I'm not an AppleScript coder or a technical person by any means but I have done some research and came across a solution for my problem statement.
My problem statement
How to make a mouse click ...
0
votes
2
answers
68
views
Get current_path if using AppleScript as osascript expression
I have a following AppleScript:
tell application "Finder"
set current_path to container of (path to me) as string
duplicate file (current_path & "foo.txt")
end tell
It ...
0
votes
0
answers
38
views
Is there any way to use osascript to run AppleScripts from an ssh session using a MacPorts installation of OpenSSH?
I'm running macOS 13.6.5, and have installed OpenSSH via MacPorts since I want to be running the latest version of OpenSSH. However, one downside to using a MacPorts installation of OpenSSH is that ...
0
votes
0
answers
21
views
AppleScript to toggle Outlook followup or clear it based on state of message
I have this script
tell application "Microsoft Outlook"
set selectedMessages to selection
repeat with theMessage in selectedMessages
if flagged status of theMessage is true ...
0
votes
0
answers
43
views
Microsoft Outlook AppleScript error
got this script for use with outlook
tell application "Microsoft Outlook"
activate
set sentFolder to folder "Sent Items" of default account
set current view to ...
2
votes
1
answer
75
views
Editing one column of table based off another
It seems like something that should be simple, and it probably is but my mind is being dense and not helping me. I have a table with two columns. The first acts as a master list of titles, and the ...
0
votes
0
answers
24
views
Need help w Apple Script reading text and copying files to new folder
I'm needing help with an AppleScript I've been using. The current script I use reads a text file that contains pdf file names, and then moves those to a different folder. This one works well but I ...
0
votes
1
answer
77
views
Open a new workspace in OSX without using the mouse
I am used to Linux environments but I have to use a Mac for work. Now I am wondering why it seems to be impossible to open new workspaces in OSX without using the mouse? I know how to switch between ...
1
vote
2
answers
84
views
Can I use Applescript to have Safari save a specific page’s contents as source?
I need to have Safari visit a specific URL, and "Save As... page source" to a specified location in my Home folder. I don't want to actually see Safari while this is going on - unless that's ...
0
votes
0
answers
15
views
Automator will only propagate "Home" from an AppleScript list picker through Selected Finder Items
I'm trying to have a user select a primary key from a MySQL database, merge that string at the beginning of a list of selected Finder items, then feed the resulting string into a bash shell script.
It ...
2
votes
1
answer
77
views
Writing a script for CotEditor to insert numbers to text [closed]
I'm trying to write an AppleScript that works within CotEditor to insert numbers inside lines of text, specifying where to add it, from what number, the increment, prefixes/suffixes and choosing to ...
0
votes
1
answer
27
views
How to export edited pictures from 'Photos" app with Applescript while preserving the image metadata?
I have written long ago an Applescript script that exports pictures selected in Apple Photos app with various basic options, such as adding borders, adjusting size, tuning for Web publishing, etc, and ...
0
votes
0
answers
65
views
Unable to kill MDCrashReportTool process via AppleScript
A long-standing bug in Mac OS X causes syncing of iDevices. You have to kill the MDCrashReportTool process to continue syncing.
I made an Automator app to run a short AppleScript to do this. However, ...
0
votes
0
answers
54
views
In AppleScript, how can you tell if an app has finished loading after it is launched?
I have some AppleScript-based automation around an application (specifically, Zotero, in case it matters). If the application is not running, I need to start it. This particular application takes ...
2
votes
0
answers
124
views
Use Applescript to check if screen is locked on a Mac with Apple silicon?
For years, I've used Applescripts to check if my Mac's monitor is locked (not to be confused with checking if the screen saver is active. I don't have the screen saver lock the screen since I use the ...
0
votes
0
answers
17
views
Applescript to select Safari import options
This applescript automates the process of importing Chrome bookmarks, history & passwords to Safari. But, I like to skip the password. How can I do that? Here is the script:
-- close google ...
1
vote
2
answers
392
views
What would it take to create Markdown support for Notes App? [duplicate]
I'm a heavy Notes user and I was wondering if it's at all possible to create limited markdown support for Notes app. For example, to create syntax highlighting for snippets like this.
const(a, b) =>...
1
vote
1
answer
173
views
MacOS Ventura cannot reset Automation preferences for a single app
I am developing an application that needs System Events as well as access to individual apps through AppleScript. When I access an application for the first time, it will trigger a dialog asking for ...
1
vote
1
answer
70
views
AppleScript getting text from (kind) of json file
I'm trying to get two value from an IP API, the geo without extra characters and "isproxy"
result is in this format :
Result:
"{\"ipVersion\":4,\"ipAddress\":\"...
1
vote
0
answers
53
views
How do I enable/disable sticky keys programmatically?
I want to disable sticky keys on certain apps. To do so, I need a way to programmatically toggle the sticky keys settings. Is there a way to do this? I am okay with compiling a binary/Applescript/etc.....
1
vote
0
answers
23
views
Automate a way to change or toggle a keyboard shortcut with either Automator or Applescript
I'm remoting into my Windows box and would like to be able to change the shortcut for Mission Control on the fly. Like a toggle switch. Specifically the move left a space and move right a space. I ...
0
votes
0
answers
24
views
spawn two apps in split view from terminal
I often use a local code editor and latexmk to get a UX similar to the Overleaf web-based LaTeX editor. To do this, I:
navigate to the project directory in terminal.
spawn a text editor in a GUI ...
0
votes
0
answers
35
views
Creating an Apple Script to change "Show as Wallpaper" option in "Screen Saver" pane
I am working on a project, and it requires toggling the "Show as Wallpaper" option to True automatically. I've tried using my limited knowledge of Applescript and looking it up, but to no ...
0
votes
0
answers
42
views
Toggle menu bar auto hide by pressing F6
My environment: Sonoma 14.2.1 on MacBook Pro 14 (2021).
What I wnat do to is:
(1) If I press the F6 key,
(2) then DND is on, and at the same time the menu bar auto hide is on.
(3) If I again press F6,...
1
vote
1
answer
48
views
Can't get shell script to talk to AppleTalk script in Automator
I'm trying to make an Automator Quick Action that will:
Take a highlighted word,
look it up in a database,
allow the user to pick from among the hits returned by the database, and
put the user's ...
0
votes
1
answer
52
views
How do you add an Apple Music track to your library with AppleScript?
Given an album ID (e.g. 1646945378) and a track ID (e.g. 1646945384), is there a way to add a track to the library using AppleScript/JXA?
macOS: Sonoma 14.2
Music: 1.4.2.83
I know you can do ...
0
votes
0
answers
26
views
How can I create an Application using Automator that will open a file from finder in VS Code as a new window?
I've found many answers and solutions that partially solve this but I can't seem to put it together.
To expand on the title, I want to be able to double click on a file and open it in VS Code as a new ...
2
votes
0
answers
40
views
Compiling an AppleScript workflow dependent on script libraries into a self-contained app
When building an AppleScript using Script Editor and some external /Library/Script Libraries, it is possible to make the final app self-contained by compiling it. I tested it by compiling a script ...
0
votes
1
answer
70
views
The means for Applescript to access the PDF menu button from the Chrome Print window changed in Sonoma
I have an AppleScript that used to work to print a Chrome tab to pdf.
I recently updated to Sonoma and the script no longer works. I have not run the script for a long time, so I don't know that it ...
0
votes
1
answer
27
views
AppleScript to prepend date to filenames works only if more than 1 file is input
I'm new to AppleScript so I'm sure it's something obvious. This works if I have selected multiple files (I use it with the right-click context menu), but if one file is selected, nothing happens (no ...
1
vote
0
answers
28
views
Faster method to tile windows without admin access
Note: I should just ask IT support to grant access, but they wouldn't allow the installation of an unreviewed app.
I don't have access to sudo or an administrator account on my macOS 13 machine.
I ...
3
votes
1
answer
89
views
Can I Make Applescript to Count Number of Files Created?
I would like to start learning AppleScript.
I want to add to my workflow a counter that will keep track of the amount of PDFs i create for a job and keep a tally of those documents. I can then forget ...
0
votes
0
answers
43
views
Automatically remount smb share on disconnect
I'm trying to write an Applescript to automatically remount an smb share when it is disconnected for whatever reasons.
I have a script to check if the share is present in /Volumes and if not then ...
1
vote
0
answers
47
views
Custom protocol handlers in Sonoma
I want to be able to insert hyperlinks into Calendar entries, such that when I click them, then the command
/opt/homebrew/bin/emacsclient -n --eval '(org-open-link-from-string \"" & ...
0
votes
0
answers
12
views
Applescript to suppress double mails from different email addresses in smart mailbox "All Incoming"
In my mail provider, I have two email accounts: one I use for my public email address: myname@publicemailname and one for my private email address: myname@privateemailname. (The myname@publicemailname ...
0
votes
0
answers
22
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
0
answers
74
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 ...
0
votes
0
answers
34
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 ...
0
votes
0
answers
86
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.
...
1
vote
0
answers
47
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
0
answers
39
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, ...
1
vote
0
answers
280
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
121
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" ...