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 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

"File > New Window" menu command: What exactly does it do? Thread Tools Search this Thread Display Modes
I am trying to make sense of the File>New Window command.
It always opens a "Contexts" perspective with the very same item selected, no matter what tasks I last selected in that perspective (which is adjusted to restore the sidebar selection).

So, may I ask *exactly* what the new window does? What kind of window is it supposed to open?

It opens whatever kind of window you have configured it to open. See the New Windows section of the General preferences.

It opens the default OmniFocus document if you haven't got a window open for it for some reason (such as closing the last one, or following an omnifocus:// link from outside the program). Remember, you can open other OmniFocus documents (such as backups, the archive or exported copies of the database) by double-clicking on them in the Finder and have them open at the same time as the default document for doing comparisons, moving data from one to the other, etc.
Thanks, Bill. Well, the reason I'm asking this perhaps intriguingly simplistic question is that I recently installed Geektools and RobTrew's associated script that prints on the desktop the currently selected action.

Now, very strangely, if all OF windows are closed (which I tend to do), Geektools does not display the last selected action but rather a seemingly arbitrary one—an action, in fact, that I haven't selected in weeks (!). Curiously, this 'arbitrary' task happens to be the one that is automatically selected if I open the "Contexts" perspective…

I hope this makes some sense.
If you've closed all of the windows, there isn't a selected action. What you get back as the currently selected action from the SQL cache is probably just an artifact of implementation decisions, or the order in which you entered the actions, or something otherwise unhelpful.
Originally Posted by whpalmer4 View Post
If you've closed all of the windows, there isn't a selected action.
Well, that is certainly what theory might predict, but OF has a surprise in store for us ...

It turns out that if you close the last document window through the GUI, (clicking on the close button at top left) there is still one invisible document window, which does in fact have a selection, and will return a value to code like:

tell application id "com.omnigroup.OmniFocus"
	tell default document
		tell content of front document window
			id of (selected trees)
		end tell
	end tell
end tell
(The invisible document window is, it seems, pre-baked in readiness to become, at the flick of the visibility switch, the New Window specified by the settings under Preferences > General > Open New Window)

I have now amended the script (to ver .7) to look only for selections in visible windows ...


Last edited by RobTrew; 2010-12-23 at 11:04 AM.. Reason: Added link to script
Thanks Rob, now it's a truly pitch-perfect script.
A further edit (1.0) has allowed it to show the active selection if OF is simply minimized (though the Applescript interface flags minimized windows as invisible).

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
No "New Action"/"New Context" menu items in 1.7? WCityMike OmniFocus 1 for Mac 4 2009-09-30 05:01 PM
Project context menu: "Complete" vs. "Completed" vocaro OmniFocus 1 for Mac 6 2007-12-11 09:18 AM
"Show in [Project/Context] View" Command dhm2006 OmniFocus 1 for Mac 5 2007-08-10 05:29 AM
"Open" command in downloads window syoutsey OmniWeb Feature Requests 2 2007-07-03 01:28 PM
"find" command in adblock window Handycam OmniWeb Feature Requests 0 2006-07-13 05:30 AM

All times are GMT -8. The time now is 11:44 PM.

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