Opening a Quark file in InDesign CS

Hello all, I’m getting a weird error that I don’t quite understand. I’ve just started a script that basically opens a Quark file in InDesign CS, does a little reformatting, and saves it as a InDesign file. The code I have so far is below:


tell application "Finder"
	set locOfQuarkFiles to folder "Path:to:Quark:Files:"
	
	repeat with i from 1 to count files of locOfQuarkFiles
		set currFile to file i of locOfQuarkFiles
		convertToInDesign(currFile)
		
	end repeat	
end tell

on convertToInDesign(currFile)
	tell application "InDesign CS"
		set currDoc to open currFile
	end tell
end convertToInDesign

As I see it, this basic script should just open the files in InDesign. However I get an error that says: “Finder got an error: Can’t continue convertToInDesign.” I don’t really understand what this means or how to fix it. I would great appreciate any help. Thanks.

Does this work?

set locOfQuarkFiles to "Path:to:Quark:Files:"

tell application "Finder"
	repeat with i from 1 to (count files of alias locOfQuarkFiles)
		set currFile to (file i of alias locOfQuarkFiles) as alias
		my convertToInDesign(currFile)
	end repeat
end tell

on convertToInDesign(currFile) 
   tell application "InDesign CS" 
      set currDoc to open currFile 
   end tell 
end convertToInDesign

– Rob

Yup, that works great. Thank you very much. In fact, I played with it a little, and my original scriot works if I just put “my” in front of the handler name. Thank you for your help