mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.8K
active users

#applescript

3 posts2 participants0 posts today

I always get a bit cagey when people ask if #HyperTalk is like #AppleScript.

There's an inspiration there, but AppleScript jettisons one of the fundamental strengths of HyperTalk: that it's designed to account for human “flaws" and logic gaps and removes the need to think about certain advanced programming concepts, whereas AppleScript actually has that logical structure under the hood and just makes it implicit … until it isn’t and you get an error message and need to deal with it.

1/6

The first and only piece of #AppleScript I have written. Very useful: Copy the geographic location metadata of one image in the #macOS #PhotosApp to a selection of other images that lack location information.

Script is available split into two pieces, as alt text in the images.

(Yes, I know Photos has Image>Location>Copy Location and Image>Location>Assign Location. I often find running this script more handy, though.)

Anyone managed to use Applescript/OSAScript to read calendar events (particularly recurring ones) from Outlook? Tried a bunch of approaches found on the internets but everything just returns {} even when there’s 6 meetings today.

(Basically I want Hammerspoon to know when I have a meeting without having to parse ICS files and all that associated trauma.)

Is there a Terminal command for sending Apple Events?

As in, I want to send an arbitrary Apple Event to an app on my Mac, given its Class and ID, and maybe add an argument or two? The event is not in that app's Scripting Dictionary.

Wasn’t there some AppleScript syntax for that, for the case where you had a script but not the associated app? Anyone know what that was and if it works with osascript?

I keep expanding the #AppleScript abilities of #NeoFinder fir #macOS for improved #automation, and NeoFinder 8.7 allows full read and write access the names of files and folders in Catalogs, and the name of Catalogs and Albums.

While that may sound a bit boring, it offers the unique ability to batch rename a lot of items with very specific text replacements!

neofinder.de/forum/phpBB3/view

Today I learned how to create a Finder alias using AppleScript and the command line:

```bash
$ osascript -e 'tell application "Finder" to make alias file to posix file "/opt/homebrew/opt/emacs-plus@29/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'

alias file Emacs.app of folder Applications of startup disk
```

This is for the particular case of creating an Emacs.app named alias at the Applications folder for the Homebrew version of the `emacs-plus` package, but changing the paths above will allow you to create arbitrary Finder aliases from the command line.

Replied in thread

@ia Wow! I didn't realize this was already working. Nice! This let me build a nice automation (#LaunchBar action) to correct text with ChatGPT. Any chance you'll add support for this to the #AppleScript library on Mac or #Shortcuts? Currently, I need to use UI scripting. It's working but it's hard to share because of the custom naming of sources. Something like this would be ideal: