I never upgrade my phone just before a trip, and I never upgrade my computer during a major project. Two weeks ago, however, I finally put The Dream of Poor Bazin to bed. You can buy it on Amazon• or any of the usual eBook sites.
So last week, I finally got around to upgrading to Catalina.
The upgrade went pleasantly well, and very quickly. It may have been the easiest macOS upgrade yet. I have now updated 42 Astoundingly Useful Scripts and Automations for the Macintosh• for Catalina. If you have the ebook, the updated version is already available at the store you bought it from, if not already downloaded to your e-reader.
If you have the print version, or if you’re just interested in what had to be changed for Catalina, I’ll have more about the specific changes later, but for the most part the scripts continued to work after the upgrade. As expected, any scripts that talk to iTunes needed to reference Music instead of iTunes. Less expected, one of the sound-effect scripts needed to change how it detected that the sound was done playing. And in the completely weird, the Contacts app started adding strange characters around some of the data it provides to the JavaScript engine.1
One more thing: the Speed Playback script is no longer necessary. Sped-up playback in iTunes was meant for speeding playback of podcasts. Podcasts now have their own app and that app includes the ability to speed podcast playback, making this script superfluous in Catalina.
You can still use the Speed Playback script on your music files, of course, if you enjoy hearing your favorite artist sound like a chipmunk. But the book is titled “astoundingly useful scripts”, not “moderately amusing scripts” despite my glee in getting Fiona to quote Hunter Thompson in the voices script. I decided to remove Speed Playback and replace it with something both astoundingly useful and moderately amusing. I’ll post the code for Speed Playback in a few weeks.
The Speed Playback script grew out of an older script that hasn’t worked for years. Quicktime Player used to be able to play files backward. This meant being able to judge for yourself whether Led Zeppelin was using Satanic backmasking in “Stairway to Heaven”. It also meant being able to listen to some of the strange things artists sometimes hide in their music.
So I decided, for the Speed Playback replacement, to write a script that plays music backward. I took a look at the various AVAudio classes and, with a bit of work, wrote a script that can read music files (or just about any audio file) on your Mac, uncompress them, and reverse the data. And then play it back or save it to a WAVE file.
So if you ever wanted to use backward clips from songs or other audio as your ringtone, the new clipper script makes it easy. Here’s a sample clumsily-backmasked mp3 file. Download it and play it. Starting at about 16 seconds and ending at about 32 seconds there’s some satanic gibberish. What is it? The clipper script can tell you:
- clipper "Secret Battle.mp3" --reverse --from 32 --for 16.5
It will start at thirty-two seconds in and play for sixteen and a half seconds backward, back down to 16 seconds in.
The new Catalina-friendly version of 42 Astounding Scripts is currently available in print at Amazon• and as an eBook at Smashwords, Apple, Barnes & Noble, and many other ebook retailers.
It still contains the ASCII art script for turning your photos into ASCII art, the piano script for playing melodies and turning them into MIDI files for Garageband, and all the other great scripts of the Mojave edition.
- February 6, 2021: Safari 14.0.3 fixes Services bug
-
A quick note that I’ve just got the update of Safari from 14.0.2 to 14.0.3, and Quick Actions that replace text inside of Safari text fields are now working again.
I’ve removed the “Copy to Clipboard” workaround (so that I no longer erase text previously copied to the clipboard) from the three scripts that I use most often in Safari, and am having no problem editing and modifying text inside of text fields.
I was getting worried that this was a permanent change, and am very happy that it turned out to really be a bug and not deliberate. It’s more than a little disappointing that the bug didn’t get caught before it went out—as both a programmer and a writer, I find Services in Safari text fields extraordinarily useful. I use it often enough that I noticed it within a few hours of performing the update. In fact, I’m using it right now. When I’m done writing this short note, I’ll run my Markdown to Blog HTML service on the text to convert simplified Markdown to the simplified HTML I use for posting.
I don’t use all of my Services scripts on a daily basis, but I do use at least one of them every day.
This is with Safari on Catalina 10.15.7. I should be updating to Big Sur soon, for varying definitions of “soon”, but would expect (or hope) that it’s either also been fixed or was never a problem on Big Sur.
- January 2, 2021: Another Safari 14 Services workaround
-
As of December 15, 2020, Safari—currently 14.0.2 on my computer, running Catalina 10.15.7—still doesn’t work with Services where the “Output replaces selected text” option is checked. The Quick Action gets the selected text, but the selected text is erased. It’s replaced with nothing.
However, one workaround, at least for commonly-used Services, is to make the last action in the workflow “Copy to Clipboard”. This will allow you to immediately paste the results into the Safari text field.
This won’t harm the Quick Action’s behavior in other apps—the script’s output will still replace the selected text. It will, of course, replace whatever’s currently in the clipboard with the script’s output, so I wouldn’t recommend using this workaround except where necessary.
I’ve used this workaround on my moronify and markdown to blog HTML Quick Actions, which I use pretty much only in browser text fields.
I’d be interested to hear if Automator Quick Actions work on Big Sur. I’m still waiting on a few app updates before I switch, but I don’t have any major projects blocking a system upgrade. Once I have Big Sur on board, of course, I’ll let you know what changes need to be made to any of the 42 Astoundingly Useful Scripts and Automations•.
- September 26, 2020: Safari 14 disables Automator Quick Actions in text fields
-
There appears to be a bug in Safari 14, released for macOS Catalina on September 17, that makes Automator Quick Actions fail. This was extremely annoying. In the morning, I was able to write in markdown on blog comments, and in the afternoon I was not.
What happens is that, if you select text in a text field in Safari and choose to run a Quick Action from the Services menu, the Quick Action runs—if it does anything outside of Safari, you’ll see those actions happen—but it replaces the text with nothing rather than with the output of the service.
You can undo to get your raw text back.
This will affect any of the simple BBCode and HTML verification/conversion scripts in 42 Astounding Scripts that are meant to be run in forum posts or blog comments.
I’m writing this in Brave, so as to be able to use markdown while writing this post. I’ve verified that Google Chrome also still works with Quick Actions. Another option would be to write it in a text editor, run the conversion, and then copy and paste it into Safari.
I’ve also used
pbpaste
andpbcopy
as a stopgap, since most of my Quick Actions are command-line scripts.- pbpaste | moronify | pbcopy
will take whatever text I just copied, run it through the “moronify” script, and then copy it to the clipboard so that I can manually paste it back into the text field it came from.
You can test that Quick Actions are half-working in Safari with a simple two-step “Hello, World” Quick Action. In Automator, create a new Quick Action. Make the first step a “Run Shell Script” that pipes the selected text to a text file on the Desktop.
- cat >> ~/Desktop/test\ services.txt
Make the second step a “Get Specified Text” that produces the text “HELLO WORLD”.
Save it as “Hello, World”.
In any text editor or word processor, or an editable text field in any web browser other than Safari, selecting some text and running Hello, World from the Services menu will (a) write the selected text to the test file on the Desktop, and then (b) replace the selected text with “HELLO WORLD”. In Safari, it will write the text, but it will replace the selection with nothing.
The JavaScript engine has had serious issues for a long time now, and may, sadly, be on its last legs. I’ll be pleasantly surprised if it survives once scripting languages have to be manually installed.
↑
Astounding Scripts
- 42 Astoundingly Useful Scripts and Automations for the Macintosh•: Jerry Stratton at Amazon.com (paperback)
- If you have a Macintosh and you want to get your retro on, take a look at 42 Astoundingly Useful Scripts and Automations for the Macintosh. These modern scripts will help you work faster and more reliably, and inspire your own custom scripts for your own workflow.
- 42 Astoundingly Useful Scripts and Automations for the Macintosh: Jerry Stratton at Smashwords (ePub)
- If you have a Macintosh and you want to get your retro on, take a look at 42 Astoundingly Useful Scripts and Automations for the Macintosh. These modern scripts will help you work faster and more reliably, and inspire your own custom scripts for your own workflow.
- 42 Astoundingly Useful Scripts and Automations for the Macintosh: Jerry Stratton at Apple Books (ebook)
- If you have a Macintosh and you want to get your retro on, take a look at 42 Astoundingly Useful Scripts and Automations for the Macintosh. These modern scripts will help you work faster and more reliably, and inspire your own custom scripts for your own workflow.
- 42 Astoundingly Useful Scripts and Automations for the Macintosh: Jerry Stratton at Barnes & Noble (ebook)
- If you have a Macintosh and you want to get your retro on, take a look at 42 Astoundingly Useful Scripts and Automations for the Macintosh. These modern scripts will help you work faster and more reliably, and inspire your own custom scripts for your own workflow.
- Astounding ASCII Art
- ASCII art images created using the asciiArt script of 42 Astounding Scripts and Automations for the Macintosh.
- Catalina vs. Mojave for Scripters
- More detail about the issues I ran into updating the scripts from 42 Astounding Scripts for Catalina.
- Catalina: iTunes Library XML
- What does Catalina mean for 42 Astounding Scripts?
- Music Hall
- Source files for the Astounding Scripts player piano.
- The Dream of Poor Bazin•: Jerry Stratton at Amazon.com (paperback)
- “All for One and One for All.” When Stephen Price Blair’s letter of introduction to White House Press Secretary Bobby Trevor is stolen by a mysterious Senator, he vows revenge against the most powerful people in DC. He risks his life, and his reputation as a journalist, to protect the President and Vice President from the plots of House Speaker Janet Richardson, and duels the Speaker’s journalists to advance the cause of beltway bipartisanship.
backmasking
- List of backmasked messages at Wikipedia
- “The following is an incomplete list of backmasked messages in music.”
- Play music faster in the Music App
- If you enjoy Marvin and the Chipmunks, you’ll love this AppleScript.
- Play this song backwards in iTunes
- Using AppleScript and Quicktime, you can play any song backwards. Find out what Fred Schneider was saying on “Detour Thru Your Mind”.
- The Secret Battle
- “Mine eyes have seen the glory”. But what is that strange gibberish in the middle?
The Dream of Poor Bazin
- The Dream of Poor Bazin (Official Site)
- The Dream of Poor Bazin: A Novel of adventure journalism in Washington, DC.
More Astounding Scripts updates
- Catalina: iTunes Library XML
- What does Catalina mean for 42 Astounding Scripts?
- Random colors in your ASCII art
- One of the great things about writing your own scripts is that when you need new functionality, you can add it. I needed random colors in a single-character ASCII art image. It was easy to add to the asciiArt script. Here’s how.
- Avoiding lockFocus when drawing images in Swift on macOS
- Apple’s recommendation is to avoid lockFocus if you’re not creating images directly for the screen. Here are some examples from my own Swift scripts. You can use this to draw text into an image, and to resize images.
- Catalina vs. Mojave for Scripters
- More detail about the issues I ran into updating the scripts from 42 Astounding Scripts for Catalina.
- Big Sur and Astounding Scripts
- Big Sur does not appear to need any changes to any of the scripts in the book.
- Two more pages with the topic Astounding Scripts updates, and other related pages
More backmasking
- Play this song backwards in iTunes
- Using AppleScript and Quicktime, you can play any song backwards. Find out what Fred Schneider was saying on “Detour Thru Your Mind”.
More honorary blog post
- Let mortal tongues awake
- Samuel Francis Smith’s America—more commonly known as “My Country, ’Tis of Thee”— is short, direct, and a wonderful hymn to God as the soul of liberty. It’s a perfect hymn for the Fourth of July. It’s also very easy to play using the piano script from 42 Astounding Scripts.
- Critical (fantasy) race theory
- It isn’t racist to address D&D characters by their race. D&D character races are things the character can do. It is racist to imply that real world races are as inferior and superior as fantasy races. Woke racism is still racism.
- The True History of the Hare and the Tortoise
- And even to this day, “a glorious victory for the forces of swiftness” is a catch-phrase in the house of the snail.
- Sparkling lights for Christmas
- This POV-Ray scene file will animate sparkling lights against a green background. If you want to make three dimensional images with lots of similar objects and then animate them, this will show you how to do it.
- O Little Town of Bethlehem
- How still we see thee lie. Play this song on your Mac’s command line with the piano script.
- One more page with the topic honorary blog post, and other related pages