I want to make a subroutine to analyse macro XML for some purpose. The only input is macro UUID.
I can use AppleScript to select the macro then use menu Edit > copy as XML to get macro XML as text. The problem is that it will analyse many macro's XML.
It's not practical to select each of all the macros in editor then do copy as XML one by one. I want it to run in background quietly.
So my question is that if there is a way to convert macro UUID to macro XML?
Thanks for reply.
But I don't think it's helpful.
Knowing how to use AppleScript doesn't mean knowing how to use AppleScript with KM.
Writing a lot of AS code cannot make you know you can do 'xml of macro id...'
Taken just by itself that one thread I linked to is limited but it is helpful if you use it with the mass of similar examples you can find here in the forum. I can guarantee that is true because that’s how I learned to use AppleScript with KM. Since all the texts about AppleScript refer primarily to the language, grammar, syntax, etc and very little information about each application that provides AppleScript support you have to spend a lot of time and effort examining the app’s AppleScript dictionary (using for example Script Debugger) which defines what facilities are provided that are accessible via AppleScript and experimenting with it.
BTW - I really dislike AppleScript and I found it very difficult to learn - as I’ve already said somewhere else in this forum. In fact, if I neglect to use AppleScript for longer than a few weeks I find I’ve become “rusty” and the learning begins again
I’m sure other users with more experience will have a different tale to tell but my answer to your question is that there’s no book of the sort you’re looking for, no quick fix and no substitute for hard graft.
I understand your words. I remembered in Script Debugger, we can check the AS dictionary for a third-party software. But still depends on luck. I havent touch SD for many years.
I hope you understand that I ask this question here because I don't want to ask then know ask then know. I think this is not polite. what I want is just a dictionary.
Since I'm not programmer, try-then-know is not practical.
I will learn to accept that ask-then-know is the only way for me.
There are no shortcuts or royal roads, alas – sooner or later you will just need to study the Keyboard Maestro osascript scripting dictionaries (one for the editor, one for the engine):
Script Editor > File > Open Dictionary > Keyboard Maestro.app
Experimentation, interleaved with questions here, yields the fastest results.
And you have a choice between using the scripting dictionaries in AppleScript or JavaScript.
See the language selector at the top left hand corner of Script Editor.
In the menu bar of the SDEF (Scripting Dictionary) browser there is a selector with a drop-down choice:
Finally, it may be worth trying a copy of Script Debugger which (for AppleScript) has an invaluable object browser – enabling you to see the live application object model (as exposed by the scripting dictionary) with its active values.
It's a very good way of getting insight into what is going on, and what the required code would need to define or update.
The number of google searches I've done that begin with Keyboard Maestro AppleScript and some sort of verb noun soup The info is here (or elsewhere!) and if it's not, then an answer is usually quickly supplied here.
I wasn't a programmer when I started studying programming, and I never received a degree in it.
I don't like AppleScript either, but I've used it just about every single day for nearly 30 years – because I do like what I can accomplish with it (and Perl, Python, JavaScript, and a few others...)
Apple has not made it easy to learn AppleScript, so hard work, mentoring, and practice is required. Every app is different and requires learning at least some new syntax.