I’m using a collaboration website that supports hashtags. However, they do not yet have a pop-up to keep track of your tags, so I have to make sure my spelling is perfect on every tag.
I’d like to type the tag in the text field in Safari, highlight it, and fire a KM macro that would copy the text into a floating palette. Later, I could put the insertion point in the text field in Safari, click the tag(s) in the palette, and KM would paste the text into the field.
Instead of a KM pallette, I would use a KM Prompt for User Input to provide the choices.
Here are the pseudo Actions to accomplish this:
Set the clipboard to "[NONE]"
Type a keystroke "⌘C"
IF Clipboard is Not "[NONE]" THEN
Set Variable DND__TagList to DND__TagList & "|" & Clipboard
(the "|" symbol is used to separate choices in the Prompt list)
ELSE
Prompt for User Input
Enter Variable myTag
Default value: |%DND__TagList%
(We need to enter a "|" first to enable the use of a variable that contains choices)
User selects desired tag & clicks "OK"
Paste myTag
END
I've obviously left out some details, but the basic logic should work.
"DND__" is the prefix I use for "Do Not Delete", so I'll know not the delete this variable when I'm doing cleanup.
I could write the macro for you, but, to be honest, you will learn more by doing it yourself. Give it a shot. If you have questions, or get stuck, feel free to reply.
All KM Variables are persistent, even across restarts of your Mac, so they generally don't need to be saved to a file.
If you open KM Preferences from the KM Editor, go to the Variables tab, and you will see all of the variables that have been created in your macros.
Could you please cobble together a basic version? I’ll learn more by looking at how you made it work right than staggering down a lot of blind alleys. Thanks.
Interesting. There seems to be something goofy going on with the SaaS web page. I can copy a word using Cmd-C or the Copy menu, but if I fire either of them from KM, it copies the URL of the page, instead of the highlighted word.
I tried making a separate macro to fire off Cmd-C using Shift-Cmd-K as a trigger. It copies the URL. If I do Cmd-C on the keyboard, it copies the highlighted text on the page. Did the same thing with Edit>Copy.
I would use the technique in Create Text Expansion From Selection Macro. Just use slightly different XML for the macro, instead of having the Typed String trigger, just put the macro in your palette macro group and it will immediately appear in the palette.
So in summary:
Macro Group configured as displaying a macro palette (in Safari or whatever).
Variant of the Create Text Expansion From Selection Macro action that creates a macro in the above macro group, no trigger required. This macro could be triggered any way you like, and could even live in the macro palette group as well.