Exporting to Clipboard with Scroll View

is it possible to use an NS Scroll View and still export the contents to the clipboard? I know it can be done with a text field, but the text field doesn’t have all the useful options that a scroll view has.

this code

	else if the name of theObject is "Export" then
		log theObject
		tell tab view item "Notes_Tab" of tab view "tabView1" of window "mainWindow"
			try
				set theExport to the contents of scroll view "Notes" as text
				set the clipboard to theExport
			on error theErr
				display dialog theErr
			end try
		end tell
	end if

gives me a NSCannotCreateScriptCommandError, i gave a text field a shot and it worked fine… but like i said, i wanted all the nifty options that come along with a scroll view.

oh, i forgot my text view… got it to work now.



else if the name of theObject is "Export" then
		log "clearing clipboard"
		set the clipboard to ""
		tell tab view item "Notes_Tab" of tab view "tabView1" of window "mainWindow"
			try
				set theExport to the contents of text view 1 of scroll view "Notes"
				log "setting the export"
				set the clipboard to theExport
				log "clipboard is set"
			on error theErr
				display dialog theErr
			end try
		end tell