View Single Post
You still need to tell Applescript which row you are operating upon, even if there is only one. A column doesn't have a value, a cell in a column does, but to specify which cell in the column, you need to specify which row.

My code gave an example of looping through all of the rows in the document. If you want to do only the selected rows, the code might look like:

Code:
tell application "OmniOutliner"
	tell front document
		set SumTotal to 0.0
		repeat with MyRow in selected rows
			set cellValue to value of cell "ricarico" of MyRow
			set SumTotal to SumTotal + cellValue
		end repeat
	end tell
end tell
and if you wanted to do only the third row, the code might look like:

Code:
tell application "OmniOutliner"
	tell front document
		set SumTotal to 0.0
		set MyRow to third row
		set cellValue to value of cell "ricarico" of MyRow
		set SumTotal to SumTotal + cellValue
	end tell
end tell