AppleScript questions/issues

Michael Terry formido at mac.com
Wed Mar 10 01:08:16 PST 2004


On Mar 9, 2004, at 10:42 PM, Brian Caldwell wrote:

> When I do something like:
>     get selected row
> I'll get back a result in the form of:
>     child 57 of child 1 of document 1 of application "OmniOutliner"
> Huh? I would expect something like:
>     row 57 of document 1 of application "OmniOutliner"
> Because I requesting it in terms of "rows". If I was asking in terms of
> "child" I would not have an issue with the result. But that would 
> require
> a "selected child" property which I don't yet see (OO 2.2.6).

Yeah, this is a weird thing which causes me some annoyance. In general, 
an application can return whatever sort of reference to an object it 
wants, no matter which reference form one used originally, but that 
usually just means a different path through the the application's 
element hierarchy. In this case, it's actually a different class! 
Here's an example of why this is a problem:

tell app "OmniOutliner" to tell front document
	get selected row
	row before result
end tell

That should have worked. Now, one can do this:

tell app "OmniOutliner" to tell front document
	get selected row
	child before result
end tell

But, of course, what if the previous row isn't a sibling, but the 
parent instead. Then it fails. That's not nice, and having to work 
around it is somewhat of a pain.

> -
> - No true currency commands (not that kind of currency ($))
> -
>

<snip>

> -
> - End result
> -
>
> Some examples:
>
> get selected column
> Result: column 4 of document 1 of application "OmniOutliner"
>
> get selected row
> Result: row 57 of document 1 of application "OmniOutliner"
>
> get selected cell
> Result: column 4 of row 57 of document 1 of application "OmniOutliner"
>
> get selected orientation
> Result: orientation "row" of document 1 of application "OmniOutliner"

I've made feature requests regarding this sort of thing, and was told 
that Omni is aware of the problem and hopes to address it. We'll see. 
I'm eagerly awaiting OO 3. I also dearly hope that we'll be able to get 
all the selected rows, not just the first row of the selection. That 
seriously limits that property's usefulness.


Mike




More information about the OmniOutliner-Users mailing list