Warm dull with a bit of drizzle this morning. Brightened by a charm of goldfinch feeding on burdock. A couple of minutes later excitement when a crow chased a sparrow hawk overhead.
Kind: Articles
I’ve noticed a big uptick in followers on BlueSky in the days since the USA election. I do wonder if we are thinking this through. Moving from one silo to another might not be the best lesson learnt from X.
Why is joining Bluesky like buying an EV? | Memex 1.1 – John Naughton
AppleScript Fun with Claude
I occasionally use AppleScript to avoid repetitive tasks. I quite enjoy writing scripts. My scripting tend to follow the guess and check procedure. It can be weeks or months between these efforts so I need to look up the library or search for many basic things1.
In my part time job, I quite often report findings or issues with the Glow Blogs system. In doing so I need to remember to include: computer model, OS version Browser and Browser version. This is quite simple but requires a few clicks and a bit of typing. I thought today I might create and AppleScript to do this for me.
I then thought I might use Claude.ai to get me started2. I used the prompt:
Can you give me a n applescript that will report on the current model of mac, the version of the OS and the current application & version?
I’ve noticed that AI doesn’t seem to be bothered with my constant typos!
The first script threw an error when I tested it. So I copied the error and the line it came from and sent it back to Claude. Another error. This continued through 10 versions. Sometimes I broke off to test an idea of my own or check the AppleScript Library and reported that to Claude.
This began to feel a bit like my usual process of testing, checking and reading. But a good bit quicker. We finally got there. I just added a line to copy to the clipboard and put the script in the Script Library so I can call it with FastScripts3.
For some reason I thanked Claude:
You’re welcome! The final script successfully gets:
1. The Mac’s hardware model
2. Current OS version
3. Active application name and version
Just for future reference – we went through several approaches before landing on the most reliable method using
osascript
to directly query the application’s version. This ended up being more robust than trying to get the version from file metadata or application paths.Let me know if you need any modifications or have other AppleScript questions!
At this point I only had one free message left. So I asked Claude to refactor the script into a shell script. This it did with one error. With no more messages left, a search produced a fix pretty quickly. I ended up with this.
- This is true of all the scripty type things I do. Except for HyperCard which I used every day for years. ↩︎
- I’ve been using free versions of AI for a while now. A few times a week. Mostly for school things. Creating a text for pupils, or questions on a text. Claude is my current fav for scripting. ↩︎
- I think FastScript is one of my favourite mac applications. It is very handy for this sort of script as you can either select it from FastScripts menu or give it a keyboard shortcut. The Front application, which we are interested in, stays at the front. ↩︎
Read: Sea of Tranquility by Emily St. John Mandel ★★★★☆ 📚
Gentle SciFi. Some of the characters from The Glass Hotel appear.
When have we ever believed that the world wasn’t ending?
And
What if it always is the end of the world?
Greenside Reservoir Late Afternoon (quarter past 3). Saw quite a few fieldfares on the way up the path.
#SilentSunday
I’d noticed that my ?random link here stopped working a while ago. A search found it had been removed from Jetpack and WordPress.com had brought it back. I asked ChatGPT for a snippet that would bring this back and it works.
The Kids found a Red Admiral in the playground today. First bit of sun for a while, but November!
I took a rather dull photos of some starlings in a bare tree yesterday. I did like the shapes, so:
convert IMG_1502.jpeg -scale 1200 -threshold 30% -fill white +opaque black bw-1200.png
Read: The Drowned by John Banville ★★★★☆ 📚
A who done it, that doesn’t focus of the crime or solution. Follows on from the previous one in a series, nothing is really clear, characters uncertain about most things. Lots of moral ambiguity.