In general, you could (and can) already do this via UI scripting (not tested in this particular case). UI scripting (AppleScript) is much more reliable (and less resource-expensive) than scanning found images.
PS:
See here, for example.
In general, you could (and can) already do this via UI scripting (not tested in this particular case). UI scripting (AppleScript) is much more reliable (and less resource-expensive) than scanning found images.
PS:
See here, for example.