OmniFocus has a Quick Entry window that floats on top of whatever window is currently active. OmniFocus has to be running, but you use the QE window most often when using another app.
Is there a way for KM to sense when the QE window is active? It floats, so it’s always on top, but it can be inactive.
I’d like to be able to make macros that will only function within the QE window.
I closed all of OmniFocus’ windows, then opened the Quick Entry window and ran your macro.
Here are the results:
minimum value missing value
orientation missing value
position -4, 23
class window
role description system dialog
accessibility description missing value
focused false
title
size 1151, 193
value missing value
help missing value
enabled missing value
maximum value missing value
role AXWindow
entire contents
subrole AXSystemDialog
selected missing value
name missing value
description system dialog
-----
I ran the macro several times, moving the Quick Entry window each time. The “Position” value on line 3 changed, so i know this is reporting on the QE window.
It returns “focused” as “false,” even though I had a blinking cursor in the window. I suspect it doesn’t see it as focused because it’s a floating window.
Is there any way to use this info to help KM tell when the QE window is open? I’d like to write a set of macros that are only active when the QE window is open.
I'm just getting caught up after being sick and then ferociously busy.
The first thing I'd do is complain (nicely) to the developers of OmniFocus that the accessibility information of their QuickEntry window is lacking.
I took a look at the demo, and I think this will probably be reliable (unless they change something):
tell application "System Events"
tell application process "OmniFocus"
tell front window
if value of attribute "AXIdentifier" = "_NS:120" then
true
else
false
end if
end tell
end tell
end tell
You won't be able to do that, because Keyboard Maestro can't see the QuickEntry window. Therefore you cannot set an appropriate window-trigger.
Since the QuickEntry window can appear in any app, you'll have to have a global trigger that checks for the presence of the window and then does or does not do its thing.