Help with script to copy text between cells

Hello,

I’ve made a large outline and then realised that the text in column 2 should really be in column 1. That is, the column with the handles. It doesn’t look like there’s any way to change which column has the handles, so I thought of copying all the text over. I’m not having much luck; here is my script so far (I have OmniOutliner with the Pro upgrade, so my app is scriptable but is called “OmniOutliner”).

tell application "OmniOutliner"
	tell front document
		try
			set rowCount to count of rows
			repeat with i from 1 to rowCount
				set myTopic to text of cell 2 of row i
				set text of cell 1 of row i to myTopic
			end repeat
		on error errormessage number errornumber
			display dialog errormessage buttons {"OK"} default button 1
		end try
	end tell
end tell

All I get is the text from cell 1 of every row being duplicated in that cell’s notes.
Any ideas?

Here’s something I use to copy all the cells in column 2 (topic column) to column 3, that may have some patterns applicable for you.

tell front document
set rowCount to count of rows
set iterator to 1
set allRows to a reference to rows (* set allRows to a reference to selected rows )
repeat with currentRow in allRows (
)
(
set currentNote to note of currentRow )
if (text of cell 2 of currentRow) > 0 then
set cell2Value to rich text of cell 2 of currentRow
(
display dialog quoted form of cell2Value )
set cell3Value to rich text of cell 3 of currentRow
set text of cell 3 of currentRow to cell2Value (
append left cell to this cell *)
set iterator to iterator + 1
end if
end repeat
end tell

Cell 1 is the notes.

Not sure if you can access it using applescript but you can drag the columns around, including the one with the handles. Click-drag on the word ‘Topic’ and you can move the whole column to the right.

I can’t tell exactly what effect you’re striving for but hopefully this helps.