Hey Dan, just have to say first off - Incredible job with KMFAM. You and @peternlewis do incredible work, it definitely does not go unnoticed - huuuuuge thanks to you both!!!
Secondly, I've been scratching my head over this for a while now - I've tried copying and editing some of your KMFAM "dependencies", which led me to try and figure out some HTML editing, which then led me to some frustrations, which somehow led me here.
Was just wondering - I'm trying to make more fully automated workflows, and part of that is loading up some of my favorite actions and dynamically filling certain fields within them automatically. Did you ever manage to fully add a favorite action to a script without user input? If so, if you could be so kind as to lend me any help, I'd really appreciate it quite a lot! Thank you!!!
I'm talking off the top of my head here, but if you set up the action the way you'd like it, then you can use "Copy as XML" to copy it. It's just text, so you can save it in a variable, or a named clipboard, or whatever.
Then next time you want to use it, you should be able to just do a "paste", assuming you have the editor focused correctly.
If you want to change something in the action before you paste, you can do a search-and-replace of the XML. Just put some token text you can find that won't match anything else in the XML. Like "$$ReplaceThis$$".
@_jims, while "Insert Action to Check Variable(s), v2.0" didn't necessarily work for what I was trying to accomplish at the moment I have to say that that is some very clever work you've done! Thank you anyways for the share, will definitely be looking into it later! : )
Just had a look at it and that looks incredibly promising - especially for some JS or other code formatting further down the road!!! For my current use case however, @DanThomas's note of being able to paste XML from a named clipboard seemed to work best!
Thank you everyone for your incredible support! : )
Dan's macro is absolutely superb and eminently useful.
My macro methodology is excellent for creating macros and/or actions on the fly with custom features.
You can use a variation of my method to work with your own favorites group by creating macros in a group with one or more actions and then using AppleScript to read them and insert them and change their attributes if desired.
Hi @EricHuergo. Yes, that macro has a unique function, but if you look at the actions near the bottom, you’ll see that they are used to do what you mentioned.
BTW, @ccstone helped me with the necessary AppleScript syntax. He's an absolute wizard and he tends to do a lot of his magic in Execute AppleScript actions.
In contrast, to avoid breaking large glass objects , I tend to use AppleScript only when necessary. So in my macro, you will see that I jump between AppleScript and other Keyboard Maestro native actions.