Hi folks--
This is the way you're supposed to get the front window when scripting OmniFocus.
However, what I learned today the hard way is that if you're running from the Script Editor, AND you have the window with your script in it located in a different one of Leopard's Spaces than OmniFocus is running in, this will not reliably return the front window.
Don't know why that is, but I tested it several times and it seems to be true.
Maybe I'll save someone some time.
Best,
David
This is the way you're supposed to get the front window when scripting OmniFocus.
Code:
tell front document of application "OmniFocus" set theWindow to document window 1
Don't know why that is, but I tested it several times and it seems to be true.
Maybe I'll save someone some time.
Best,
David