hey
i could really use some help here! i just can't figure this out and full disclosure i'm a newbie when it comes to these things.

here is the unix command that i am issuing through ARD

osascript <<EndOfMyScript
tell application "System Events"
tell application process "loginwindow"
key code 125
delay .5
key code 125
delay 1
keystroke return
delay 2
keystroke "2634"
keystroke return
end tell
end tell
delay 2
tell application "Gaming Introduction 30m"
activate
end tell
EndOfMyScript


two problems:

1) the application "Gaming Introduction 30m" launches fine but it doesn't come to the front and the icon bounces in the dock instead of bringing the dialogue box that is supposed to pop up to the forefront. is this a "focus issue" or something of that nature?

2) the command never seems to finish in ARD, it never completes. it is like it is stuck on something. why doesn't the unix command finish in ARD when once the "Gaming Introduction 30m" has finished launching?

here is the script code for the "Gaming Introduction 30m"

delay 2
on box()
set done to false
set question to display dialog "Have you been to Vantage before?" buttons {"Yes", "No"}
set answer to button returned of question
if answer is equal to "No" then
tell application "QuickTime Player"
activate
open "/Gaming Introduction.mp4"
present document 1
delay 2
tell application "System Events"
keystroke " "
end tell
end tell
delay 178
tell application "QuickTime Player"
quit
end tell
delay 1
tell application "Gaming Introduction" to activate
set question to display dialog "Do you want to watch the video again?" buttons {"Yes", "No"}
set answer to button returned of question
if answer is equal to "Yes" then
tell application "QuickTime Player"
activate
open "/Gaming Introduction.mp4"
present document 1
delay 2
tell application "System Events"
keystroke " "
end tell
delay 178
tell application "QuickTime Player"
quit
end tell
end tell
end if
end if
tell application "Menubar Countdown"
activate
delay 0.5
tell application "System Events"
keystroke tab
end tell
delay 0.2
tell application "System Events"
keystroke "30"
end tell
delay 0.2
tell application "System Events"
keystroke tab
end tell
delay 0.2
tell application "System Events"
keystroke "00"
end tell
delay 0.2
tell application "System Events"
keystroke return
end tell
end tell
end box

box()

i would really appreicate any help, advice or hints!
thanks so much!

peace will