Skip to main content

Questions tagged [applescript]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
34 views

How can I get the Console to display "can’t" instead of "canÕt"?

It's only a small thing I guess, but I'm annoyed to see errors reported in the console for my AppleScripts where the text of the error message contains substitute characters. e.g. Error Number: -43 ...
softlee's user avatar
  • 11
1 vote
1 answer
37 views

How to create a new iTerm2 with a keystroke and bring just this window to front

I've searched for quite a while now, I talked to numerous artificial intelligences, real intelligences and I tried many things including apple script and iTerms python API. But it seems impossible to ...
Daniel's user avatar
  • 11
1 vote
1 answer
37 views

MacOS Music script does not work triggered inside app

For years, I've been using a really simple AppleScript to reset Music's AirPlay device back to my computer. I trigger it using a keyboard shortcut Command + E and the script doesn’t run. Same if I use ...
nigel's user avatar
  • 13
1 vote
0 answers
29 views

Applescript application disappears from login items after running once

I have an AppleScript application (i.e. an AppleScript exported as an application) in my "Login Items" list which disappears from the list after running once. The script itself is simple: ...
not_great_at_apple_script's user avatar
1 vote
1 answer
43 views

How can I program my Mac to know when my iPhone is home?

Situation: I wrote an alarm clock app that runs on a MacMini. (No, I have never found any commercial app that works like I want it to.) But sometimes I spend the night away from home, and I don’t ...
Snarke's user avatar
  • 11
0 votes
1 answer
28 views

Is it possible to automate Music.app to play a random album by one specific artist?

I have lots of 'albums' in my library in Apple Music which are by a certain artist. I find these good to work to. They are all relatively similar (dance music mixes.) I would like to make an ...
Diggory's user avatar
  • 798
0 votes
0 answers
21 views

How can I automate opening a new window if none exists in the current space by a dock click?

I've been customizing my Mac to enhance my productivity and there’s one last hiccup: the Dock's behavior with spaces and opening new windows. Context I use separate spaces for different activities—...
ogaompa's user avatar
0 votes
0 answers
15 views

Make it easier to toggle color filters

I need a more convenient way to toggle this option. I'm happy for it to be a toggled at a keystroke, an option in my top menu bar, or an option in this thing: I initially tried ChatGPT to write an ...
libby's user avatar
  • 151
0 votes
2 answers
38 views

How to find the desktop which contains a Terminal window

I have a Terminal window on desktop 1 running some unit tests. On desktop 2, I'm using Chrome on the Internet. I want to run an applescript at the end of unit tests, in order to switch to desktop 1. I ...
Philippe's user avatar
  • 125
1 vote
0 answers
49 views

Music.app Select Songs Listing via Applescript

I would like to Select the "Songs" library view (in the left-hand pane) via Applescript, but all I can do is select the Album view by doing the following: tell application "Music"...
Rusty H's user avatar
  • 11
1 vote
1 answer
51 views

Is there a Terminal command to run the Confetti reaction/effect in a video call?

Is there a Terminal command to run the Confetti reaction/effect in a video call? Or maybe AppleScript? https://support.apple.com/en-us/105117
fatFeather's user avatar
0 votes
0 answers
48 views

ERROR: Expected end of line, Any ideas?

I am trying out something for Photoshop using apple scripts and I am getting this error: 628:632: syntax error: Expected end of line, etc. but found command name. (-2741) does anyone know what could ...
Acki D's user avatar
  • 9
1 vote
1 answer
49 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, ...
Fred Leonard's user avatar
0 votes
0 answers
12 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 ...
Feuermurmel's user avatar
0 votes
1 answer
25 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 ...
emonigma's user avatar
  • 1,047
4 votes
1 answer
62 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 ...
Cookie's user avatar
  • 143
1 vote
1 answer
43 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 ...
Tysonic's user avatar
  • 11
0 votes
0 answers
10 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 "...
Dmitry's user avatar
  • 57
0 votes
1 answer
48 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 ...
Anshu Chang's user avatar
0 votes
2 answers
78 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 ...
jsx97's user avatar
  • 125
0 votes
0 answers
41 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 ...
Bri Bri's user avatar
  • 2,518
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 ...
zeltak's user avatar
  • 249
0 votes
0 answers
45 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 ...
zeltak's user avatar
  • 249
2 votes
1 answer
78 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 ...
user717452's user avatar
0 votes
0 answers
27 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 ...
thompkinz's user avatar
0 votes
1 answer
79 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 ...
jo87casi's user avatar
  • 101
1 vote
2 answers
104 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 ...
Seamus's user avatar
  • 4,640
0 votes
0 answers
16 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 ...
Jan Steinman's user avatar
2 votes
1 answer
92 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 ...
Thad_Supersperm's user avatar
0 votes
1 answer
48 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 ...
Yves's user avatar
  • 185
0 votes
0 answers
82 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, ...
Richard Cosgrove's user avatar
0 votes
0 answers
70 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 ...
mhucka's user avatar
  • 1,337
2 votes
0 answers
160 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 ...
2oh1's user avatar
  • 947
0 votes
0 answers
18 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 ...
Safiq Rahman's user avatar
1 vote
2 answers
926 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) =>...
CupOfGreenTea's user avatar
1 vote
1 answer
217 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 ...
Lucas van Dongen's user avatar
1 vote
1 answer
86 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\":\"...
Kevin's user avatar
  • 2,378
1 vote
0 answers
58 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.....
HappyFace's user avatar
  • 622
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 ...
Glenn Wark's user avatar
0 votes
0 answers
30 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 ...
japreiss's user avatar
  • 101
0 votes
0 answers
48 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 ...
HarlanCheese's user avatar
0 votes
0 answers
62 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,...
Springfield's user avatar
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 ...
Jan Steinman's user avatar
0 votes
1 answer
74 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 ...
cherryblossom's user avatar
0 votes
0 answers
29 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 ...
James0r's user avatar
2 votes
0 answers
41 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 ...
user776686's user avatar
0 votes
1 answer
94 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 ...
Carl Sorensen's user avatar
0 votes
1 answer
32 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 ...
Rosie's user avatar
  • 1
1 vote
0 answers
34 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 ...
Vedaant Arya's user avatar
3 votes
1 answer
110 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 ...
rcktship's user avatar

1
2 3 4 5
69