The problem here is that URLs can’t have spaces in them. When I paste it into Things, it assumes that the space is the end of the URL and tries to link to a file named ‘Test’ instead of ‘Test File.txt’:
We could just never use spaces in our file paths, but the Mac has supported spaces in file and folder names since time immemorial. Instead, we can get around this by URL encoding the path, replacing the space with %20. You could do this manually, but that would be a pain and we’d also have to replace any other characters that aren’t valid in a URL. Instead, we can use URL encoding software to make all the necessary substitutions for us. If you want to play around with it, there are websites that will URL encode text for you. If this is something you want to make part of your workflow you probably want to script it (this can be done using the Filter action in Keyboard Maestro and setting it to “Percent Encode for URL”).
This gives us: %2FUsers%2Fchris%2FDocuments%2FTest%20File%2Etxt
In order to make Things or other programs that automatically convert URLs to links recognize this as a URL we need to put file:// in front of the URL-encoded path (just like URLs for websites have “http://” at the front).
If I click the link it will open my Documents folder in a Finder window with Test File.txt selected. ⌘-O will open it in whatever the default app is for that file type.
@MacSparky David, could you explain how your “minimize all windows” Keyboard Maestro macro works or what actions it uses? I can’t find a way to minimize all in the “manipulate a window” action. I was hoping it was a downloadable macro in the Keyboard Maestro Field Guide but couldn’t find it.
Contextual Computing is an amazing concept, I’m looking forward to more development of this!
@ismh I am now doing the same. Once I realized that I could import markdown files and could bulk export any notes from Craft in four formats if and when needed, I made Craft my default note taking application. It is also working well as a PKM app. While I like Obsidian, I’m finding Craft more flexible and better suited to my needs. Very impressed so far and the developer, Viktor, has been helpful and responsive.
Fascinating episode as always. Just a quick note on how I’m using MIDI triggers with BetterTouchTool, Keyboard Maestro, and HomeKit on my Mac.
A few of the knobs on my M-Audio keyboard typically go unused, so I’ve assigned BTT “Value Changed” triggers - which run AppleScript to invoke Keyboard Maestro to send hotkeys to the “Homie” (Menubar app) to control the brightness of the left and right desk lamps.
Homie (or HomeControl) allows you to assign individual hotkeys to Scenes - though HomeControl throws an alert if you send keystrokes faster than it can respond.
Very cool. I didn’t know about this either. Inspired by your Text Expander snippet, I made an Alfred Workflow to do the same thing. I put it here: https://github.com/ethanweed/Alfred-make-UUID
After some back and forth (since Catalina’s Notes AppleScript brook), Hook [generates URLs for notes based on their date-time stamps]( Using Hook with Apple Notes – Hook). Apple doesn’t directly expose the Notes URLs, but I am hopeful they will follow the trend towards exposing links in a helpful manner.
well, as we’re on the topic of hook://file// URLs, another distinctive feature of course is that hook://file// can be shared with others (e.g., in Git, SVN, Dropbox, etc.). You can even email the file to someone along with a link. They can move the file around and still use the link. Those cases require the last part of the pathname to be the same. We tweak the algorithms over time to optimize robustness. Hook also supports deep linking of PDFs, so you can point deeply into the PDF (interchangeably with Skim, PDFpenPro and soon Adobe Acrobat). etc.
Same here, not sure what difference there is between the uuid scripting option, and generating these date specific ones, other than that you can sort the latter?
Yes. One of the reasons that I would love to know swift. You can use it as a 'shell script’ as long as you start with the proper shebang, as shown above:
Right. It was the “Showing Of The Shebang” (movie title?) that got me asking. My assumption is that something (not sure what exactly) interprets or compiles the script. Might not run fast, of course.
This is a great idea and a useful Alfred workflow. Unfortunately, when I click on the supplied GitHub link a 404 error is returned. Any thoughts? Thanks again for sharing.