You can create a new window, then use GetURL to have that window focus on the task in question:
tell application "OmniFocus"
tell default document
set MyTask to task id "35678" -- or whatever you've done to get MyTask
set MyTaskURL to ("omnifocus:///task/" & (id of MyTask))
tell (make new document window)
GetURL MyTaskURL
end tell
end tell
end tell
This script will take a selection and open it in a new project window. The next step might be to modify it to (try to) close the tool bar and the sidebar. I think this can only happen through AppleEvents.
on run
tell application "OmniFocus"
tell content of front document window of default document to set MyTask to the value of every selected tree
tell default document
set MyTaskURL to ("omnifocus:///task/" & (id of first item of MyTask))
tell (make new document window)
GetURL MyTaskURL
end tell
end tell
end tell
end run
Dan Byler’s script is fantastic, given that double-clicking is not an option. However it does not display completed tasks. Does anyone know how to make it display all the tasks in the project?
The simplest way I can think of to accomplish seeing a task in the context of its project with all completed tasks showing is this:
Set the Projects perspective to show All and save the perspective.
Open the project of the task in question with Cmd-O. Voila: a new window with that project and all tasks showing.
Maybe Dan Byler’s script also relies on the Projects perspective…
Cmd-O requires typing the name of the project. Dan Byler’s script is two clicks. Select an action, click on his icon. Not as good as the double-click method in OF1, but better than Cmd-O for me.
However I’m less concerned about this than I was. Now I use Dan Byler’s for actions, and the OF2 focus command for projects. That more or less does what I want.
I now understand what you were saying. Setting the Projects perspective (which I never use) to All does affect the result of Dan Byler’s script. Thanks!