The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Sidebar or content selected? Bug in Applescript support? Thread Tools Search this Thread Display Modes
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:
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
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get a list of selected canvases using applescript fikovnik OmniGraffle General 0 2013-01-09 07:25 AM
Values of 'item' nodes in sidebar/content trees have no properties RobTrew OmniFocus Extras 1 2011-06-27 02:39 AM
Applescript for Appending Notes to Selected Rows kmlawson OmniOutliner 3 for Mac 4 2011-03-07 09:32 AM
Trouble with scripts that require selected trees of content akelley OmniFocus Extras 7 2007-12-13 02:40 AM
applescript: print selected perspective steve OmniFocus Extras 1 2007-11-17 05:25 PM

All times are GMT -8. The time now is 05:47 PM.

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