In my tests, the current copy macro works fine with macros that have only one trigger. Do you mean copying a particular trigger from a macro with multiple triggers? Because that is admittedly a use case I did not account for
At any rate, the AppleScript for grabbing the XML of a macro with only one trigger is considerably simpler, so hopefully this will help you modify the macro copy to incorporate the user prompt:
tell application "Keyboard Maestro"
xml of trigger 1 of item 1 of (get selection)
end tell
If you are talking about grabbing a particular trigger from a macro with multiple triggers, one easy way to do it would be to just use the trigger’s number in the above AppleScript (i.e. trigger 2
instead of trigger 1
. You can arrive at that number fairly easily just by counting the triggers from the top down. Of course, the real trick would be entering the number of the trigger you want in a user prompt and then having KM enter that automatically so you don’t have to modify the script each time, but unfortunately I don’t have time to figure that out at the moment. If this is what you meant and you haven’t figured it out in a day or so, I should be able to take a crack at it.
And thank you so much for the kind words, both here and in the other threads! I’m glad these macros are already proving useful