Skip to main content

New answers tagged

0 votes

AppleScript (Music.app) error: Can't get duration of current track

It's weird having to re-enable automator app in Privacy & Security > Accessibility everytime it has been changed, but so far found only a terminal shortcut to open its window to make it a bit ...
Dmitry's user avatar
  • 67
1 vote

Use AppleScript to search for message by subject

I've been able to search mail by subject using the AppleScript below: tell application "Mail" open (every message of inbox whose subject contains "KeyPhrase") end tell I have ...
Izaac Post's user avatar
2 votes

How to osacompile a script containing `tell Application` and NSAppleScriptEnabled without activating it

You are correct that the application is launched to get its scripting terminology. Your best bet would probably be to create and test the individual scripts, then escape each script as a string and ...
red_menace's user avatar
  • 1,470
1 vote
Accepted

How can automatically insert Shortcuts output into the current window?

There is a built-in option to do what you want In the shortcut options menu (🛈 in the right top side) mark "Use as Quick Action" and in the sub-menu of that mark "Provide Output". ...
yehsuf's user avatar
  • 133
1 vote

Toggle menu bar auto hide by pressing F6

The following AppleScript automates the toggling between Always and Never modes for automatically hiding the menu bar on macOS 14.5 (Sonoma): tell application "System Settings" reveal ...
preseren's user avatar
0 votes
Accepted

Change app's icon by script

Using the answer from @wch1zpink , I was able to come up with a solution that uses the Foundation framework instead of UI scripting. There's a caveat: it works when run in Automator but not as a ...
JBart's user avatar
  • 31
1 vote

Change app's icon by script

You should not alter files in an application bundle, as that may break the code signing. Also, the Finder's scripting dictionary shows the icon property as being a bitmap, so you would need to ...
red_menace's user avatar
  • 1,470
1 vote

Change app's icon by script

This following solution is not exactly what you may be looking for but I think it is enough to set you on the right path. This following AppleScript code uses the fileicon shell script utility. If ...
wch1zpink's user avatar
  • 7,621
0 votes

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

Based on the answer given by @hym3242 I came up with the following script: tell application "System Events" tell application process "Dock" tell list 1 tell UI ...
Daniel's user avatar
  • 13
5 votes
Accepted

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

The AppleScript command write (logEntry & return) to writetoTheThing starting at eof writes the string in Mac OS Roman encoding (or probably the “system encoding” – a remnant from old Mac OS ...
Martin R's user avatar
  • 1,027

Top 50 recent answers are included