Ugly Works: Test for blank field

I need to test if a field in a Lightroom Plug-in is blank, as part of a set of KMacros to work around limitation in Lightroom that the plug-in author has not resolved. The author has told me that this is the #1 feature request for this plug-in.

Following @JMichaelTX's helpful suggestions in this KM forum topic (Ten gallon chapeau!), I have written a macro that works, but is it at ugly^2. Any suggestions for making this monstrosity lithesome?

The application is Adobe Lightroom.
The Plug-in is "Any Tag", by the estimable John R. Ellis.

My KMacro is:

The ugly parts are:

  • The macro never gets to the "otherwise execute" Actions, and
  • The macro never gets to the "until" Actions.
    What happens is that the Copy Action loops until it fails. I have set the timeout for the Copy Action to 50/100th of a second, and to abort after timeout.

    This works. In fact, it works well. But it's like eating nutritious insects. Any help appreciated.

The big problem I didn't actually work around is that OS X's "copy" does nothing when nothing is selected. From a user standpoint, this is helpful. From a computer standpoint, copying nothing should result in the clipboard holding a null entry. The entire work-around is to un-do the system's "helpful" insistence that it not copy nothing.

In the actual, larger context:
I use Lightroom every day, for hours. "Any Tag" is a great help in assigning keywords to photos (Lightroom uses this last term with an unhelpful indistinctness). Because of limitations in Lightroom's plug-in architecture, Any Tag's author has not found a way to have the window listing the already-assigned keywords default to an empty keyword field. This puts a parlous wrinkle in the keyboard workflow: after launching Any Tag, one must tab to an empty field or risk over-writing an already-assigned keyword. Hence the need for a work-around, for which I resorted to Keyboard Maestro.

This KMacro is actually one of four which I use together to make Any Tag work smoothly.

  • one macro launches Any Tag and then calls the macro which makes the first blank keyword field active (I had been using an OS keychord to launch Any Tag — but re-assigned this to my KMacro when I needed to call another KMacro immediately after launching Any Tag.) This KMacro is in my "Lightroom" Group.
  • one macro (the subject of this topic) makes the first empty keyword entry field active. This is in my "only active when Any Tag window is primary" Group.
  • two macros make the next or previous photo active while keeping the Any Tag window open. This is done using a "click on found image" action followed by calling the "make first empty field active" macro. These, too, are in my "only active when Any Tag window is primary" Group.

If anyone has any suggestions for improving this set-up, I am nothing but ears.