Unable to escape loop:: script request

Hihi
I’m trying to run a script that plays a movie on QuickTime and once the movie stops, open a presentation file on Appleworks 6. My current script so far opens QuickTime and runs the movie, but won’t open the document.

note: Didn’t come up with this script myself, just editted somebody elses.

tell application “QuickTime Player”
activate

tell movie 1
	rewind
	play
	repeat
		if (the current time = 1) then
			exit repeat
		end if
	end repeat
	tell application "Appleworks 6"
		activate
		open location "file:///Users/dyluth/documents/test.txt"
	end tell
end tell

end tell

I don’t have access to AppleWorks but does this work?

 set doc_fol to path to documents folder as Unicode text

 tell application "QuickTime Player"
  activate
  tell movie 1
   rewind
   play
   repeat
    if (the current time = 1) then
     exit repeat
    end if
   end repeat
  end tell
 end tell

 tell application "AppleWorks 6"
  activate
  open alias (doc_fol & "test.txt")
 end tell

– Rob