Is there a way to export not the macros contained in a smart group, but just the smart group itself?
Hi, @Evan_Mangiamele.
I don't think so, but you can select the Smart Group and select Edit > Copy as > Copy as XML.
If you paste the clipboard into a text editor you'll at least have the Search Strings which you could subsequently copy-and-paste.
Maybe someone else will have a better idea.
A Rube Golderg macro.
This macro exports not selected Smart Groups, but a macro set to make the selected Smart Groups with AppleScript.
After selecting the Smart Groups, run the macro.
From the prompt list that appears, choose the macro group where the exported macro should appear when imported.
From a Prompt for New File dialog, choose the name and destination.
Opening the newly created .kmmacros file will import a macro to the macro group specified earlier.
Running the macro will create the Smart Groups selected earlier.
Advanced troubleshooting:
Cross whichever fingers you're not using during all of this.
Export Smart Group Installer.kmmacros (17.6 KB)
Depends on what you mean by "the smart group". You could "export" the modification date, for example, but not import it.
So assuming that what you actually care about is
- The Smart Group's name
- Its search criteria
...you can grab those with AS and then, later, create a new Smart Group using those values.
Here's a demo of both. Pop it into Script Editor, select a (sacrificial, just in case!) Smart Group in KM, run the script. It'll activate KM so you can see what's going on then delete and, 5 seconds later, recreate the Smart Group:
tell application "Keyboard Maestro"
activate
set {theName, theSearch} to {name, search strings} of item 1 of (get selection)
delete item 1 of (get selection)
delay 5
make new smart group with properties {name:theName, search strings:theSearch}
end tell
One nice thing -- only Smart Groups have search strings
, so selecting anything else will result in an error and not the deletion of all your macros!
Wow. This is quite the macro!!! I'll admit it's probably overkill for what i'm actually trying to do, but very cool.
Thanks! This is great. Simple and to the point. I ended up pivoting and deciding to just re-organize my macros for now to avoid using a smart group for the purpose I intended, but i'll keep this in my back pocket in case I decide to re-visit it!