Applescript: obtain selection from the Project list
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=fudster;63098]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.[/QUOTE]
[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[/CODE] |
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=fudster;63151]I'd like to have a way to determine from AppleScript the order in which the trees were selected...[/QUOTE]
I think you'll find that this information is not recoverable - the sequence of elements in [I]selected trees[/I] is not affected by the order in which they were selected. |
thanks RobTrew... I'm proceeding with the list-dialog approach...
Cheers! |
All times are GMT -8. The time now is 02:44 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.