AppleScript get selection?

Lorin Rivers lrivers at gmail.com
Thu Dec 22 11:42:25 PST 2005


On 12/20/05, Russ McBride <Russ at psyex.com> wrote:
>
> Am I correct in thinking that there is no way to use AppleScript to figure out what the
> currently selected cell is and modify the text in it?

Actually you can, but of course AppleScript with its opaqueness makes
it a little difficult to suss out...

Try this (watch out for line breaks):
tell application "OmniOutliner Professional"
	set theContents to {}
	repeat with i from 1 to (count of columns) of document 1
		set theText to text of cell i of selected row 1 of document 1
		set end of theContents to theText
	end repeat
end tell

If you needed an arbitrary selection (more than 1 row, or just a
single selected cell) you could probably wrangle that.

Hope that helps! Couldn't have done it without Script Debugger!


More information about the OmniOutliner-Users mailing list