If you want to determine if the sidebar or the content pane of an OF window is selected (i.e. which has focus), it seems to me that the way to find out via Applescript is to use the 'selected' property of:
sidebar/content of document window 1 of default document
Is this correct?
If correct, then there is a bug: I always get false for both. Here is sample code:
Note: as a workaround you can use the 'selected tree' of sidebar or content, but this only works if you don't have a selection in either the sidebar or the content area, which is rare.
sidebar/content of document window 1 of default document
Is this correct?
If correct, then there is a bug: I always get false for both. Here is sample code:
Code:
set windowPartSelected to SidebarOrContentSelected() display dialog ("Content pane selected: " & (item 2 of windowPartSelected) as text) & " Sidebar selected: " & (item 1 of windowPartSelected) as text on SidebarOrContentSelected() tell application "OmniFocus" tell default document set sidebarSelected to selected of sidebar of document window 1 set contentSelected to selected of content of document window 1 end tell end tell return {sidebarSelected, contentSelected} end SidebarOrContentSelected