I’ve been rebuilding a #RaspberryPi installation that supports my classic Mac habit 😄
I used to use the awesome #MacIPGW image which includes a ton of pre-configured software like #netatalk. But it hasn’t been updated in a while so I used it as excuse to start from scratch.
I used this Pi Zero W as my starting point. HDMI video stopped working on it for unknown reasons. I added an Ethernet/USB hub hat and a #TashTalk 2 hat for #LocalTalk devices.
So I have a new MacOS 9.2.2 #AppleScript Folder Action attached to a network share via netatalk. It works only if these conditions are met:
The folder is open already in the Finder. If it’s closed, it never triggers.
The new item is added to the folder from the current machine. Items added remotely to the network share do not “refresh” therefore never trigger the action.
Ok, I've abandoned Folder Actions as it just doesn't seem to work. I've now gone with an always-running #AppleScript to scan the folder.
And.. it works! Almost? It seems that MacPalette II crashes (and takes Acrobat Reader with it) after it completes a print and there's a finder dialog that's proving difficult to dismiss in AppleScript.
A print is initiated from a device to the CUPS-PDF driver on my #netatalk Raspberry Pi.
The resulting PDF is placed in the AFP share of netatalk/afpd.
An emulated PPC Mac 9.2.2 running the #AppleScript below is watching for new files in that folder and will print them using Acrobat Reader to the #ImageWriterII via #LocalTalk using the MacPalette II driver.
It works, but crashes with dialog that I can't auto-dismiss.
The #AppleScript dictionary in #NeoFinder has been expanded to give you read and write access to the #Finder#Tags (aka Finder keywords) and the color labels of NeoFinder.
@philsplace Are you trying to get the janky #Apple Music app to play nice with their janky #AppleScript and janky #iCloud sync? I wish you the best of luck.
Managed to get an #Elgato Stream Deck running a #python script to approve Github Pull Requests the other day.
The more I dug in, I realized that this is not a super obvious pattern. So I started documenting how to do this, and figured it might be useful to other folks that search for this topic.
me: “Do you have any timeout-related functionality?”
AS: "Sure, you can use a with timeout of 20 seconds … end block”
me: “Oh, good! Then I'll wrap the repeat until block inside a timeout block”
AS: "LOL NOPE”
And scene.
—-
Seriously, if you think the surrounding timeout would cancel the contained repeat block like in a real programming language, I got news for you. Let me just wipe off my tears first
DEVONthink 3.9.4 is now available. The update mainly provides bugfixes for macOS Sonoma. However, we also fixed an important issue with the OCR and imprinting AppleScript commands not working. And we made some refinements to sync, especially concerning iCloud syncs. #devonthink#macossonoma#sonoma#applescript#update#pkm
#AppleScript grammar is sorta specified in the AppleScript Language Guide but not formally.
Does anyone know if there’s a formal grammar specification for any version of AppleScript? The paper from Cook et al has a fragment of a formal grammar.
The way tokenization works with multi word commands and dictionary-specified constants and such seems relatively straightforward (basically dynamically modify the set of keywords inside tell blocks, greedily tokenize heads).
We have updated three optional scripts for DEVONthink for Mac: Combine Document Windows, Display Random Note, and Loren Generator. Install or update them from Scripts > More Scripts… #devonthink#applescript#pkm#productivity#workflow
It is ridiculous that I have to rely on ProcessSerialNumbers(!!!) and an API that was deprecated in 10.9 (!!!!) (SetFrontProcessWithOptions) because [NSRunningApplication activateWithOptions] (from 10.6!!!) cannot properly handle its two options. All I want to be able to do is activate an application, regardless of whether I or it was active, with or without all the windows coming forward with a non-deprecated API – is that really too much to ask?
Use AppleScript, that at least still works, but you need to know the name of the app you wish to activate.
tell application "Microsoft Excel" to activate
We also use #AppleScript to get and set Finder comments, for files and folders as Apple until this day is unable or just unwilling to provide an actual API for that. Such a joke.
This time, we provide a search and replace tool for metadata fields.
For example when your CEO spontaneously decides to change the company name from "Amazing Inc." to the boring (sic!) but new name "Xyz Inc.", and you must replace the Copyright text in all photos immediately.
I can’t shake the feeling that every time I actually use #AppleScript, someone at #Apple has to stuff a dollar bill into a barrel sitting on someone else’s desk in Cupertino, and the receiver is snickering and saying something like “that bet sure paid off”
@czottmann@thomasfuchs I’m genuinely curious: what kind of things can you do with #AppleScript and Safari that can’t be done with Firefox and some extension/s? For context: I’m a long-time #Firefox user in all the OSs, and a fan of #Shortcuts. And I hate with passion having to write AppleScript 😅