Thanks for the help, that solved it. Select certainly is picky. I rewrote the sample with some additional explanation, and added selecting an action. If you only want to select a project or folder, leave out the 'tell content' block.
NOTE: code assumes there is a task in a project that is directly in the Library (not in a folder).
The bug that you can't get or set the selected property of the content or sidebar of a window is also shown.
I wrote OFSelectAny() to make it easier to select:
http://forums.omnigroup.com/showthread.php?t=11886
NOTE: code assumes there is a task in a project that is directly in the Library (not in a folder).
Code:
tell application "OmniFocus" tell default document -- example: get a reference to an action (task in Applescript) and its parent project set project1 to first project whose status is active set task1 to task 1 of project1 whose completed is false tell front document window -- The parent project of an action (task) must be selected before you can select the action. tell sidebar -- to select a project or folder, you must tell the sidebar select {project1} --must be a list end tell tell content -- to select an action, you must tell the content select {task1} --must be a list --The focus may be on the sidebar or the content, select doesn't change it. --The following should change focus to the content area: set selected to true -- bug in OmniFocus: doesn't work end tell end tell end tell end tell
I wrote OFSelectAny() to make it easier to select:
http://forums.omnigroup.com/showthread.php?t=11886
Last edited by davidamis; 2009-04-08 at 06:16 PM.. Reason: added link to OFSelectAny() post