AppleScript or Automator progressive enumeration of task list
I’m having some difficulty wrapping my head around the AppleScript (and Automator, which is related) support in Life Balance 5.
Since tasks present themselves as an outline, I was hoping to walk down through an outline to get to a certain point. This would partly be for integration with other utilities, like LaunchBar.
I can do the following to get the top-level tasks:
tell application "Life Balance"
get every subtask of document 1
end tell
I’d like to develop a subroutine — a handler, in AppleScript — to get and return the subtasks of a parent task passed to it. With that, I think I could present an interface to progressively selecting tasks down through the outline.
My difficulty lies in selecting subtasks of a passed parent task, and the repetition of that step. I must be having problems referring to the task objects or something, because everything I do generates an error. Does anyone have any working code or suggestions for how to do this?
As an alternative, I tried out the Life Balance Automator actions. (It would be great if these actions weren’t saved as run-only scripts, because they would provide some sample code on how to write AppleScript scripts for Life Balance. As it is, they are opaque.)
These actions seem so close, but I have a different difficulty with them. If the “Create tasks” action could accept a variable for the “Create new tasks under task” field, then I believe I might be able to do something closer to what I want. Unfortunately, it doesn’t accept an Automator variable — and the input to that action goes right to the name of the task that is created. Without the ability to set a variable as a second input, I cannot see how to walk the task list.
Any ideas would be appreciated. Thanks!


Maybe a first step!
Jaharmi,
Does this help:
tell application "Life Balance"
set theList to (get every subtask of document 1)
set theCount to 1
repeat with i in theList
make new task at end of i with properties {name:"Test" & theCount}
set theCount to theCount + 1
end repeat
end tell
I am curious: what integrated task do you want to accomplish with the help of LaunchBar?
Martin