Scritping the enter Key

Hello,

Im trying to copy text from TextEdit into an audio synth called SuperCollider. The copy and paste works…the problem is that SuperCollider needs to recieve an enter (not return) keystroke to compile the data. Also, keystroke return while holding fn works too. Anyone have any ideas on how to script the enter or fn + return?

Brian

Here is what I have:

tell application “SuperCollider”
activate
tell application “System Events”
if UI elements enabled then
tell process “SuperCollider”
set frontmost to true
end tell
keystroke “n” using command down
delay 1.82
end if
end tell
end tell
delay 2.87
tell application “TextEdit”
activate
delay 3.21
tell application “System Events”
if UI elements enabled then
tell process “TextEdit”
set frontmost to true
end tell
keystroke “n” using command down
delay 0.2
end if
end tell
tell text of document 1
make new word at word 1 with data “{ EnvGen.kr(Env.perc, 1.0, doneAction: 2) * SinOsc.ar(440,0,0.1) }.play;”
tell application “System Events”
if UI elements enabled then
tell process “TextEdit”
set frontmost to true
end tell
delay 2
keystroke “a” using command down
delay 2
keystroke “x” using command down
tell application “System Events”
if UI elements enabled then
tell process “SuperCollider”
set frontmost to true
end tell
keystroke “v” using command down
delay 1.82
keystroke “a” using command down
delay 1.37

					beep -- here is where the enter heystroke needs to be
					
				end if
			end tell
		end if
	end tell
end tell

end tell

this should press the enter key rather than return


keystroke (ASCII character 3)

Thanks! That works:) perfect.

Brian

Or:
tell application “System Events”
keycode 76
end tell