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
and pbcopy
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.
I’ve reported this as a bug to Apple via their Safari feedback form. The problem may also be related to this behavior.
In response to 42 Astounding Scripts, Catalina edition: I’ve updated 42 Astounding Scripts for Catalina, and added “one more thing”.
- 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•.
- 42 Astoundingly Useful Scripts and Automations for the Macintosh
- MacOS uses Perl, Python, AppleScript, and Automator and you can write scripts in all of these. Build a talking alarm. Roll dice. Preflight your social media comments. Play music and create ASCII art. Get your retro on and bring your Macintosh into the world of tomorrow with 42 Astoundingly Useful Scripts and Automations for the Macintosh!
- Safari 14 seems to break system services
- “Safari 14 seems to break system services. Select part of a Web page, invoke service, pasteboard claims to have all the right data types, but the datas are empty.”
- Safari Feedback at Apple Computer
- “Use the form below to send us your comments. We read all feedback carefully, but we are unable to respond to each submission individually. If you provide your email address, you agree that we may contact you to better understand the comments you submitted.”
More Safari
- Another Safari 14 Services workaround
- Another workaround to Safari 14’s Services bug is to copy the results to the clipboard.
- Safari 9.1 frees your browser from JavaScript lockup
- Safari no longer blocks closing tabs or windows when it displays a JavaScript alert.
- Safari 8.0.7 can block endless alerts
- The latest update to Safari on Mac OS X 10.10.4 allows blocking endless alert loops.