script to set window to inbox?
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[/CODE] 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[/code] |
Ah, of course. Thanks a bunch for the idea!
|
[QUOTE=Craig;21199]Now my question is this: Is there a way to tell the front document window to go to the inbox?[/QUOTE]
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 [/code] |
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 [/code] Thank you Tim for the original code. |
All times are GMT -8. The time now is 02:50 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.