@peternlewis It used to be that we couldn't paste KM XML for actions, macros, or groups directly into the editor. We had to set the proper clipboard type, like com.stairways.keyboardmaestro.actionarray, com.stairways.keyboardmaestro.macrosarray, or com.stairways.keyboardmaestro.macrogroupsarray.
Now we can paste plain-text Actions XML. Nice.
But we can't paste plain-text Macros or Groups XML. Any plans on changing that?
Secondly, and I don't know the right way to word this, you've possibly changed how the XML needs to appear when pasting in XML for Macros, when using com.stairways.keyboardmaestro.macrosarray. For instance, if I use "Copy as XML" on a macro, and put it back on the clipboard with the proper clipboard type, it won't paste back in. I have to remove the enclosing Groups before it will paste in.
It didn't used to be this way, I don't think, although I suppose I could be wrong. But in any case, it would seem to me that if I used "Copy as XML", I ought to be able to paste that back in just like I can with actions.
I'm always learning things. I don't think I ever noticed that "Copy as >" pop up menu item on macros. In fact, I don't think I even noticed the "Copy as XML" option in the cogwheel of an action, even though I use that cogwheel a hundred times per day. I must have tunnel vision, seeing only what I want to see.
There is no one XML format for a macro. There is different XML formats for the macro when referenced in different ways, and they aren't interchangeable. Some variants include the parent macro group information and some do not, depending on the required context.
Generally, if the purpose is for export, then it will include the groups and otherwise will not.
The various com.stairways.keyboardmaestro.* flavors are internal flavors, subject to change, and if you want to put things in there then I'm afraid you're on your own for ensuring that the format is correct - I don't keep track of the various formats or document them because the code handles what it needs to handle.
If you want to copy a macro, copy the macro. If you want to preserve that, save it to a Named Clipboard (though this is still subject to change just like the saved clipboard of a graphic program object might stop working if you update the program).
Anything that uses XML is at the edge of support. At some point in the future, Keyboard Maestro may entirely change its storage system and XML might not be supported or might change entirely.
Creating macros based on XML via AppleScript should continue to work for the foreseeable future, but the exact format of the XML required is whatever the exact format of the XML required is, it is not something I specify.
And the clipboard flavors are similarly whatever they are and subject to change.
So it is not a question of whether I support them - they are supported in the form that they are, but I don't document the XML (and frankly don't really know what the XML is without looking myself) or ensure that the XML does not change from version to version.
Dammit, Peter, I was all set to argue with you, and then you go and say something I totally agree with.
I will ask this, though. If you ever decide to move away from the XML, I'd appreciate it if you could let me in on it beforehand, perhaps even be on the beta-testing program (but I only want to do that for something like this). I have a crap-ton of published macros that will break, which is on me of course, but I'd like the chance to mitigate as soon as possible. Thanks, and I know there are no promises, but I thought I'd put that out there.
Seeing people argue is usually exciting. Seeing people agree is a little boring.
Change is usually good, when it's planned by people. I'm not good enough of a programmer to read between the lines here to figure out what might be coming, but I'm drawing the inference that KM may store its data in a database in the future so that it becomes more efficient at data storage. I think the main benefit (for me) will be that the KM Editor will be much speedier. I look forward to that. In the meantime, I will continue to have a great life with KM just as it is. It's such a great product. My memory isn't perfect, but I think my first version of KM was KM v2, and I bought it from the Apple App Store.
Only Keyboard Maestro versions 4.4 (Mac App Store specific version of Keyboard Maestro more or less identical to version 4.3.2), and 5.x were ever in the Mac App Store. Mostly 2011.
Keyboard Maestro 2 was released in 2004.
Correct. Even if I used a database, it might be that the macros themselves were stored in XML.
The main advantage of a database would be that the editor did not have to write the entire XML file every time you make a change which would remove the restriction on the macro file size affecting the editor performance.
The editor also has performance issues related to long macros, which are cause by UI controls and would not likely gain anything from being in a database.