View Single Post
I am playing with putting things into OO4 via applescript. Please note that I am new to apple scripting.

This script does more or less what I want:

Code:
tell application "OmniOutliner"
	set MyDoc to front document
	set myText to "Hello World!"
	-- set the note of selected row to myText
	set note of selected rows of MyDoc to myText
	-- set the cell of selected row to myText
	set topic of selected rows of MyDoc to myText
	
	set curRow to selected rows of MyDoc
end tell
Still, a few questions remain:
- is it correct to set the "topic" of a row to the text (or is there another way)
- in my current document, for a selected row, I get for example

Code:
{child 2 of child 1 of child 2 of document id "aGFw5TYjAVs" of application "OmniOutliner"}
- this is wonderful, because this contains the number that I seem to need: 2+1+2, which is the ID of the current row, which I seem to need when I want to add an attachment (as the ID of the row in this example script)
-- is this the way to get to this ID, or are there other ways? I played with

Code:
set rowInd to index of first selected row of myDoc
set rowDepth to level of first selected row of myDoc
but I wasn't successful.