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

 
Applescript: obtain selection from the Project list Thread Tools Search this Thread Display Modes
I've seen how we can obtain (i.e and subsequently iterate over) the selected projects/tasks using "selected trees or "every selected tree", when that selection is in the main content window.

But I'm having a heck of a time figuring out how to do the same for the selection(s) in the project list on the left. I was to perform operations on (and within) those using Applescript.

Any hints? Thanks in advance.
 
Quote:
Originally Posted by fudster View Post
I'm having a heck of a time figuring out how to do the same for the selection(s) in the project list on the left. I was to perform operations on (and within) those using Applescript.
Code:
set lstTrees to the selected trees of content
if the (count of lstTrees) is less than 1 then
    set lstTrees to the selected trees of sidebar
end if
 
Ah, sidebar huh... RobTrew, that works perfectly - thanks!

One more question about selection, if I may... I'd like to have a way to determine from AppleScript the order in which the trees were selected...

So, say I have:

Folder1
- Project1
- Project2

If I select Project2, then hold down the Cmd key to select Project1, the order I get when I iterate using "repeat with" is the top-to-bottom order in which the projects appear in OF (not surprising, of course).

For what I'm doing now, I want to ascribe a significance to the first project I select (the other projects are dependent on completion of the first one; I want to set project statuses and insert tasks with linkages).

For this scenario I could display a dialog for selection of the currently-active project, but I'd prefer to be able to select that project first and then select the other "blocked" projects subsequently using multi-select. Does anyone know of a way to read the order in which the trees were selected, in AppleScript?
 
Quote:
Originally Posted by fudster View Post
I'd like to have a way to determine from AppleScript the order in which the trees were selected...
I think you'll find that this information is not recoverable - the sequence of elements in selected trees is not affected by the order in which they were selected.
 
thanks RobTrew... I'm proceeding with the list-dialog approach...

Cheers!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having problems w\project selection Dave C OmniFocus for iPad 1 2012-02-27 09:53 AM
View and Sort Task List across selection of multiple Projects os4 OmniFocus 1 for Mac 2 2010-11-17 09:59 AM
Use of Outline or List for selection lawencehare OmniGraffle General 1 2008-11-04 12:43 PM
Export issue / Modify the selection in a Document via AppleScript / Scripting Bridge Scifer_2008 OmniGraffle General 0 2008-10-08 06:06 AM
Capturing selection with AppleScript MB_UST OmniFocus Extras 1 2008-06-14 06:26 AM


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


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