Wednesday, April 5, 2023

Making HTML links with Alfred workflows

I finally found a good use for ChatGPT: I had it write two workflows for the Mac app Alfred. It took the bot about a half dozen tries over several days to produce workflows that work. Thanks, AI.

URL+text creates an HTML link with selected text from the current tab in Safari. It’s simple: highlight text, press Command-C to copy, and press the hotkey. The link will be on the Clipboard. You can make the hotkey whatever you like. I like Control-Option-Command-T, a combination not likely to be confused with anything else.

URL+title creates an HTML link with the title of the current tab in Safari. It’s even simpler: press the hotkey and the link will be on the Clipboard. Here too you can change the hotkey to whatever you like. I like Control-Option-Command-L.

It’s baffling to me that the App Store offers no decent extension to accomplish such elementary tasks. (URL Linker for Safari does not work properly in Ventura, at least not on my Mac.) It’s also baffling to me that the Alfred forums appear to lack Workflows for these tasks. Granted, it’s ultra-easy to create links in Markdown, but not everyone uses Markdown.

I’ve placed both workflows in my Dropbox for downloading: URL+text, URL+title. Use at your own risk. But I don’t think there’s any real risk involved. Note: Alfred is a free app, but workflows require the not-free Alfred Powerpack.

If anyone knows how to have a workflow recognize highlighted text without the need for Command-C, I’d love to know.

[What about asking ChatGPT to write a working Quick Action in AppleScript? Unpossible! AppleScript seems to defy both artificial and human intelligence.]

comments: 0