Howdy folks, lately I've been doing a little bit of Dropbox housecleaning. I keep all of my AppleScript, JavaScript and HTML files in there that way KM can reference them from any of my computers.
However, I am seeing that I have a lot that I believe have fallen into disuse for one reason or another. But before deleting them, I would like to verify that I don't have them embedded in a macro somewhere. But searching in the KM Editor for the file path, or even the file name does not show me any results unless the search scope is part of the action's title.
So is there a way to search so that the results will include file path fields and there the file name I'm trying to find?
Aren't all the macros stored in a single file? (I can't remember its path/name.) Did you consider opening that file in a TextEditor and searching that file for the names you want to find?
There is, it's in Keyboard Maestro's Application Support directory, and I did consider it... but I'd rather avoid that if possible in case I were to screw up the file.
I know I can simply duplicate the file and open/search through the duplicate, and I'm not opposed to doing that (since I already have one other macro that does something similar), but I figured I would reach out and see if there was a simpler solution first.
@ComplexPoint thanks for the tips... I'm pretty ignorant on JavaScript... but I built a macro (I got bored haha) that simply duplicates the plist file and then opens it in BBEdit allowing me to search it for the file name... (more on that below), but how would your route be better/more efficient? Ultimately I would love to be able to have the search run in the background that way it requires no input from me (other than triggering the macro perhaps).
This is what I have right now. The TL;DR version is it duplicates the KM plist file, opens it in BBEdit, and searches it for the file name supplied at the beginning (either from the Finder's selection or the prompt for file action). It then asks what you want to do with the file, and then tags it or trashes it accordingly.
It works great for me, I just went through a large folder of AppleScript files in about a minute and found every one that is and is not in my KM plist file and tagged them accordingly. Let me know how you think this could be improved because if it proves useful enough (and safe enough) I would be willing to share it in the Macro Library category.
Thanks Chris, that's so weird... in the past (even the other day when I was searching for some specific embedded files) there were some instances where a search wasn't showing them even though I know they were embedded in some macros.
This morning I searched for others and it did show me the ones I searched for this morning. So maybe I was simply messing something up with my search.
Either way... I think I'll stick with the macro I built (I already rebuilt it twice and am happy with the final result), but this is good to know too.
-Chris
EDIT: Hey @Sleepy I went ahead and built a macro to search the plist file (well, a duplicate of it anyway haha), and here's a screen recording of it in action. I may post it to the forum later on.