Keystroke Return Not working?

I’m trying to run the following subRoutine, but when it reaches the “Keystroke Return” line, nothing happens. The Save as Tiff window just sits there, highlighting the File Name and unhighlighting it. I’m a total rookie at this, so any help would be greatly appreciated.

on saveStack(tcsName)
	my do_submenu("ImageJ", "File", "Save As", "Tiff...")
	delay 1.5
	tell application "System Events"
		tell process "ImageJ"
			tell window "Save as Tiff"
				keystroke "Stack" & tcsName & ".tif"
				delay 1
			        keystroke return
			end tell
		end tell
	end tell
end saveStack

I’m working in OSX10.4.9 Thanks!

Try

on saveStack(tcsName)
   my do_submenu("ImageJ", "File", "Save As", "Tiff...")
   delay 1.5
   tell application "System Events"
       tell process "ImageJ"
           tell window "Save as Tiff"
               keystroke "Stack" & tcsName & ".tif"
               delay 2
            key code 36
           end tell
       end tell
   end tell
end saveStack

key code 36 is return, and try a longer delay.

If not work out the button with Prefab UI Browser and click it.

Have fun

Hi rat02000
try

on saveStack(tcsName)
my do_submenu(“ImageJ”, “File”, “Save As”, “Tiff…”)
delay 1.5
tell application “System Events”
tell process “ImageJ”
tell window “Save as Tiff”
keystroke “Stack” & tcsName & “.tif”
delay 1.5
click button “Save” of window “Save as TIFF” __ maybe try a click?
end tell
end tell
end tell
end saveStack

heres a link to UI browser

http://prefabsoftware.com/uibrowser/

Budgie

Thanks guys! The Click “Save” button worked like a charm… Although I did have to take out the extra “of window “save as tiff”” since it was already in the tell window.