All Notes to Children?
Michael Terry
formido at mac.com
Thu Feb 17 18:43:26 PST 2005
On Feb 17, 2005, at 6:20 PM, Curtis Clifton wrote:
> Brian,
>
> On Feb 17, 2005, at 5:29 PM, Brian Vito wrote:
>
>> I have an outline in which I've used a lot of notes, but now I'd like
>> those notes to be children. ... An illustration:
>>
>> 1. Hello
>> This is a note.
>>
>> to:
>>
>> 1. Hello
>> a. This is a note (although it isn't actually a note anymore)
>>
>
> Here's a partial solution. Perhaps another scripter on the list can
> see how to finish it:
>
> tell front document of application "OmniOutliner Professional"
> set theNotedRows to (selected rows whose note is not "")
> repeat with theRow in theNotedRows
> tell theRow
> set theNote to text of note
> set note to ""
> make new row with properties {topic:theNote}
> end tell
> end repeat
> end tell
>
> This script takes every row of the current selection (do an expand
> all, select all for processing every row) and converts every note to a
> child item. The problem is the new "note children" are placed _after_
> any existing children instead of before. That is:
>
> 1. An Item
> An item's note
> a. A child item
>
> becomes:
>
> 1. An Item
> a. A child item
> b. An item's note
>
> Does anyone know the right incantation to make a new row before the
> existing children? Every combination I've tried seems to lead to an
> NSEvaluationError from OO3 (which is probably a bug, but I don't know
> for sure).
>
>
I think the relative insertion references are almost the most confusing
thing about AppleScript application scripting (esp. in Cocoa apps), at
least, the hardest thing to figure out without an example. This works:
tell application "OmniOutliner Professional"'s front document
make child at before first row's first child
end tell
--
Michael
More information about the OmniOutliner-Users
mailing list