I'm trying to create a few of my first KM macros and am running into some trouble with one.
I'm trying to assign the keyboard shortcut ⌃N to Open Ulysses, go to my Inbox group, create a new sheet, and then insert a TextExpander snippet for my basic note.
When I press the shortcut it seems to do the last step (the ;uly) while still in the open dialog, like it's getting ahead of itself. I've tried adding in manual pause actions, and running through the macro step by step in the debugger (which works perfectly), but I still can't get it to work properly with the keyboard shortcut.
Any tips for this KM novice would be greatly appreciated I've read great things about this application and really want to get it automating things well for me!
Hello, I added the pauses to the macro, otherwise the process is too fast. Please adjust the pauses (yellow) of your hardware. Maybe they need to be longer.
I’ve heard of the Ulysses X-Callback-URL before, but TBH I had no idea how to even use/understand it But it seems to be a great thing in this case since it’s built in by the developers themselves. @unlocked2412 I’ve switched out the variable from “Hello world” to my TextExpander snippet, but it isn’t expanding. It’s just leaving the snippet ‘;uly’ Any clue on how to get that snippet to expand after properly?
First, let me say I highly approve of your Link avatar
As to your snippet, what does it expand to? If it’s not too complex and/or reliant on TextExpander-only functionality, I think it might be easier and more robust to replicate it in KM and use that in place of the “Hello World” variable.
It really isn’t a complex snippet. It expands to:
(#
(##
(-
(-
So an H1, H2, a return, and a couple of empty bullet points (without the parenthesis). And then having the cursor inserted back at the H1. I know I could just fill that Markdown in the KM variable, but is KM also able to control the cursor location too?
And thanks, this version of Toon Link is one of my favs
KM is indeed able to control the cursor location with the %|% token, so in KM parlance, you could recreate that snippet like this (you can use backslashes here to escape markdown characters like # and - so that they show up as intended):
#%|%
##
-
-
Unfortunately, that won't work when included as part of a URL like this, so you would need to stick with your original idea and have it inserted in the newly created Ulysses sheet once Ulysses is frontmost (especially since it seems like you want to use this macro to quickly start typing, which the x-callback URL scheme doesn't seem to help with since, at least in my tests, it doesn't bring focus to the newly created sheet). Here's a version of your original macro idea that uses Pause Until and Select or Show a Menu Item actions along with the snippet that positions the cursor (in my experience, I've found the former to be faster than arbitrary Pause actions, and the latter more precise then simulated keyboard shortcuts):
I’m sure the text snippet would need to be URL encoded. As a sample try a %20 instead of a space. (That’s a percent char, followed by a 2, and then a 0.)