Very neat. I'll be interested to learn your experience in how this works out in your plugins. In the past, in different contexts, my experience with keystroke stuffing (on Windows) was that it was "fragile". I've thought a bit, and here are some of the issues I've encountered in the past: It's hard to handle dynamic application behavior. A simple example is LR's Library menu -- when a non-folder source is selected, there is one menu command (Plug-in Extras) with S shortcut key, but when a folder source is selected, there are two (Plug-in Extras, Synchronize Folders), and thus the keystrokes needed to invoke Plug-in Extras vary depending on the LR source. Since I rarely use folders as sources in LR (my workflow is not folder-based), I didn't even see this behavior until an Any File user point it out to me. In general, the developer of a plugin using keystroke stuffing would have to carefully test it out in all the different LR contexts in which the plugin might be invoked). More complicated behavior, such as confirmation dialog boxes that only appear based on selection or application state, can be more problematic. Manipulating dialog boxes has been troublesome for the utilities I've used. They typically have some facility for waiting until a dialog box appears, and then resuming the keystroke stuffing. But if the application doesn't use the standard Windows toolkits (and at least some Adobe applications don't), the utilities may not be able to find the dialog box by name. So then you have to program in a delay in your macro. If you make the delay too short, the macro will fail. If you make it too long, the user has to wait. And if the user starts typing during the middle of the macro execution, you'll get unpredictable results. A lot of apps don't follow the Windows conventions and don't fully implement the standard tab, cursor key, and enter semantics (again, I've experienced that with Adobe apps). While the utilities allow you to use relative mouse coordinates to "move" the mouse and make mouse clicks, that's incredibly fragile, since the app window could have different layout each time it's invoked. Despite all this, I've used keystroke macros to automate routine tasks in Photoshop Elements Editor (which disabled the action recording of full Photoshop) and Photosohop Elements Organizer. But they were not entirely reliable. But it may very well be that the uses you're envisioning for LR plugins will be straightforward and robust enough.
... View more