Convert row to note of parent row?

Curt Clifton curt.clifton at mac.com
Sun Jan 15 17:16:15 PST 2006


John,

On Jan 15, 2006, at 5:50 PM, John Laudun wrote:

>
> Here's something that happens to me regularly: I realize that a  
> row, or
> series of rows, really should be a note attached to the parent row.  
> The
> ability to do this is not built into OO Pro itself, but is it  
> possible to
> write an AppleScript to do this -- if someone would but say yes, I  
> would try
> it myself.
>
> Of course, it would also be cool to have a script that would do the  
> reverse,
> transform notes into child row(s).

Here's a script to do the reverse that I had lying around.  Turning  
child rows into a note is also doable.

-- Splits notes of selected row into multiple rows, one for each  
paragraph
-- Leaves all other data for the selected row attached to the  
original row
tell front document of application "OmniOutliner Professional"
	try
		set v_selrow to selected row 1
	on error
		beep
		display dialog "You must select a row to split." buttons {"Close"}  
default button "Close"
		return
	end try
	
	set v_parent to v_selrow
	set v_topic to note of v_selrow
	set theParagraphs to every paragraph in v_topic
	
	-- Nothing to do? Then do it.
	if (count of theParagraphs) is 0 then return
	
	-- Creates the new rows
	tell v_parent
		repeat with v_p in theParagraphs
			make new row with properties {topic:v_p} at ¬
				after last child of it
		end repeat
	end tell
	
	set note of v_selrow to ""
	set expanded of v_selrow to true
end tell


Cheers,

Curt


More information about the OmniOutliner-Users mailing list