Thank you so much Dan. This macro is phenomenal like all your other macros. You really make some really slick tools.
However the macro stopped working for me. Perhaps it is because I have minimised the window where you add the macro and after quit KM. Now none of the triggers work and I don’t know how to fix it. What can I do to fix this?
First, in a temporary macro of some kind, add a "Semaphore Reset" action, with the name of the semaphore "kmfamSemaphore" (without quotes) like this:
Then run the temporary macro (or just select the action and click "Try"). Let me know if this solves the problem, because if it does, I have some questions for Peter.
If you still have a problem seeing the Select window, go into Keyboard Maestro's Preferences, to the "Variables" tab, then find and delete the variable "DND__kmfamWindowPosition". Again, let me know if that solves the problem, so I can fix that issue.
Yes! Yes!! Yes!!! I never met another developer with this obsession and the problems that it causes. My argument was always that the time I spent on tools would be paid back in faster work, not just for this project, but for future ones, and especially when other people use them. Didn’t convince anyone much. Suffered a lot of criticism over this, sometimes with serious consequences, but I was never able to stop.
This is a double edged sword though. Especially spending a lot of time on micro optimisations, it becomes kind of addicting trying to shave off a few seconds there and there and often is just an example of procrastination. So I think one should really strike a good balance between automation and trying to automate things for the sake of automating, a balance that is often quite hard to find in my opinion. For me, keyboard customisation and working on optimising my personal workflow is kind of like a hobby. I enjoy trying out new things and seeing what works best for me.
I don’t know about you but I am more and more amazed and joyous when I sit down and get to use my laptop. All of these micro and macro optimisations and a wonderful list of applications that exist on this platform are just superb and it is an endless fun in itself trying to make use of them and especially bring them together in a way that works best for you. Without KM, BetterTouchTool, Karabiner, PopClip, Typinator, Bartender I would really find it a hard time trying to make myself use all of these tools and apps in a way that is efficient and usable.
I am actually curious, what other tools do you guys use aside from Keyboard Maestro that you enjoy and love? Perhaps I should make another topic post with this question.
@peternlewis Peter - We had a situation where a Semaphore didn’t get unlocked. You can wade back through if you want, or here’s the gist:
While one of my my macros was running, which had a semaphore locked, @nikivi shut down KM. The semaphore didn’t get unlocked. I can’t duplicate this on my machine, so I’m not sure what happened.
Got any ideas?
PS to @nikivi: A semaphore is something that can only be locked by one process at a time. I lock the semaphore at the start of a KMFAM macro, and it should automatically get unlocked when the macro finishes. This way I make sure that only one KMFAM macro runs at a time. Otherwise, some variables might get confused. (If you need specifics, let me know.)
Semaphores are not stored to disk. So my guess would be that the macro was actually still running in the Keyboard Maestro Engine, and by “shut down KM” all that happened was the Keyboard Maestro Editor was quit. If the Keyboard Maestro Engine was quit, then all semaphores would be reset.
I could be wrong, there could be some way for Semaphores to be left locked when the macros are all quit, but its unlikely as there is actually a safety feature built in so that whenever there are no macros running, if there are any semaphores still locked, they will be released with an error report in the log file.