The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Sidebar or content selected? Bug in Applescript support? (http://forums.omnigroup.com/showthread.php?t=8082)

davidamis 2008-05-29 09:29 AM

Sidebar or content selected? Bug in Applescript support?
 
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:
[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
[/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.


All times are GMT -8. The time now is 06:39 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.