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

 
script to set window to inbox? Thread Tools Search this Thread Display Modes
I'm loving the new scriptability to move to perspectives, e.g.

Code:
tell application "OmniFocus"
	tell default document
		tell front document window
			set perspective name to "waitingfor"
		end tell
	end tell
end tell
Now my question is this: Is there a way to tell the front document window to go to the inbox?
 
There might be a way to script it natively, but you can emulate the shortcut with System Events (you need GUI Scripting enabled)

Code:
activate application "OmniFocus"
tell application "System Events"
	tell process "OmniFocus"
		keystroke "1" using {command down, option down}
	end tell
end tell
 
Ah, of course. Thanks a bunch for the idea!
 
Quote:
Originally Posted by Craig View Post
Now my question is this: Is there a way to tell the front document window to go to the inbox?
Yep! ...

Code:
tell application "OmniFocus"
	tell front document window of default document
		set selected view mode identifier to "project"
		tell sidebar to select inbox
	end tell
end tell
 
Note that the answer of Tim Wood is better:
- it doesn't need to have GUI scripting enabled
- it doesn't rely on shortcut, which can be changed
- it's a cleaner code :p

Thank you Tim
 
I use this script during my reviews, and a few times throughout the day.

Sometimes, I closed the last window of OmniFocus, and the script won't work.

Here is an improved version that should take care of this.

Code:
tell application "OmniFocus"
	
	tell default document
		if number of document window is 0 then
			make new document window with properties {bounds:{0, 0, 500, 500}}
		end if
	end tell
	
	tell front document window of default document
		set selected view mode identifier to "project"
		tell sidebar to select inbox
	end tell
end tell
Thank you Tim for the original code.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-platform batch script to fill my inbox Dominik OmniFocus Extras 7 2012-03-03 11:06 AM
Script to return a task to the inbox johnrover OmniFocus Extras 10 2010-11-24 02:43 PM
Script to print email as pdf to inbox attachment Millerworld OmniFocus Extras 2 2009-04-29 02:24 PM
Script to jump from inbox to project RobTrew OmniFocus Extras 1 2008-03-08 10:14 AM
Inbox notifier script Schimmi OmniFocus Extras 0 2007-10-05 01:02 PM


All times are GMT -8. The time now is 12:05 AM.


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