The Omni Group Forums

The Omni Group Forums (
-   OmniFocus 1 for Mac (
-   -   "File > New Window" menu command: What exactly does it do? (

macula 2010-12-22 11:54 AM

"File > New Window" menu command: What exactly does it do?
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?


whpalmer4 2010-12-22 12:10 PM

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.

macula 2010-12-22 12:23 PM

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.

whpalmer4 2010-12-22 01:17 PM

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.

RobTrew 2010-12-23 04:50 AM

[QUOTE=whpalmer4;90783]If you've closed all of the windows, there isn't a selected action.[/QUOTE]

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 [B]invisible[/B] document window, which does in fact have a selection, and will return a value to code like:

[CODE]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[/CODE]

(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 [URL=""]the script[/URL] (to ver .7) to look only for selections in [I]visible[/I] windows ...


macula 2010-12-23 12:51 PM

Thanks Rob, now it's a truly pitch-perfect script.

RobTrew 2010-12-27 04:02 PM

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).

All times are GMT -8. The time now is 07:26 AM.

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