Even though the new addition of 'jump to macro from the debugger' has been a huge addition for me that I use all the time...so I rely on the numbers much less...
I was wondering if there is a way to find the next available number so I can number the next macro I'm creating.
My numbers are Kxxxx, always a K followed by 4 digits.
Is there a way to query my KM macros and show me the highest number to date?
And / Or if there is a whole in the sequence? (number missing)
Keyboard Maestro's global variables are accessible from all macros and are persistent across invocations. If you keep the last macro number in a global variable, you can retrieve it and increment it in any of your macros.
To preset the variable, create a new variable in KM's Variables preference pane and fill it with your current highest number.
As for figuring out where the holes are in your numbering system, I think that could be done via AppleScript, but there may be an easier way.
Woof! Such a simple solution, awesome. The only catch is that I work on 6 to 10 different computers. So I guess Iβll just create a macro named next macro number and put the number in the title of the macro and thatβll be synced to all the computers. How simple!!
Awesome solution, thank you!
Hey @DanThomas , really want to say how appreciative I am of your time and expertise on this forum, really excellent stuff my friend..... seriously, thank YOU.
ok, yeah, they are always at the end of the macro name ie.
Multi β§β₯ Space Shift Option Time - Set K0345
Kens ββ Scroll Up Cnt Cmd VARIABLE K0099
Multi Kens Global β+β»B4 Cmd B4 VARIOUS K0027
Multi Left β Command VARIOUS K0010
the word 'various' is not always in the title, but definitely the last 5 characters of the macro name are always Kxxxx
Thanx man!
When I run the macro it returns 'Max Number: 0'
I have it in my KM group and there are macros in that group that have the Kxxxx at the end of the macro title.
Run it, and give me the results - not all of them, just 10 or 20 lines. You can pick and choose which lines to post, if there are names you don't want to share. Just don't alter the lines you do share.
"Multi Kens FMP β§ββ₯β+B2 ShConOptCom VARIOUS 0012"
"Multi Kens FMP β§ββ₯β+B4 ShConOptCom VARIOUS K0013"
"Multi Kens FMP ββ₯β+B2 ConOptCom VARIOUS K0019"
"Multi Kens FMP ββ₯β+B4 ConOptCom VARIOUS K0014"
"Multi Kens Global β§+B2 Shift VARIOUS K0005"
"Multi Kens Global β§β+B2 Shift Control VARIOUS K0006"
"Multi Kens Global β§β ShCom Scroll Up VARIOUS K0026"
"Multi Kens Global β+B2 Control VARIOUS K0007"
"Multi Kens Global ββ₯+B2 Cnt Opt VARIOUS K0028"
"Multi Kens Global β+β»B4 Cmd B4 VARIOUS K0027"
"Multi Kens Global β+B2 Cmd B2 VARIOUS K0029"
"Multi Kens Global β₯+B2 Option VARIOUS K0008"
"Multi Kens Global β₯+B4 Option Button 4 VARIOUS 009"
"Multi Kens Global β»B2 VARIOUS K0021"
"Multi Kens Global β»B4 USE VARIOUS K0017"
"Multi Kens Global Cnt Cmd B2 VARIOUS K0015"
"Multi Kens GlobalCnt Cmd B4 VARIOUS K0016"
Right now, if something ends in 4 digits, that's the number I'm using. So, for example, if something ends in only 3 digits, it doesn't get included. I'm not checking for "K".
Also, I'm doing this for all your macros, not just the ones in the group you this from.
Let me know if that's how you want it to work or not.