Quark 4 script worked in 10.2, not it 10.3

I’m in Quark 4.11 on OS10.3
this line worked in 10.2, but is now stopping the script with “QuarkXPress� 4.11 got an error: Can’t make some data into the expected type.”
What am i missing? (variables i and pageCount are determined elsewhere) The rest of the script works fine.
I’ve tried “as alias”, “as file” and various incarnations without luck

save it in (fileName & i & “+” & (pageCount + 1 - i))

I can’t even find a script around here that saves a Quark file that i can use as a reference
Please help, many thanks in advance.

I use this script for batch processing Quarkfiles (Quark 6, OS 10.3.2)
Don’t know if it works for Q4.

set theFolder to choose folder --Folder with files you want to process
set theFiles to list folder theFolder without invisibles
set fileTypes to {"XDOC", "XPRJ"}
set theFolder to theFolder as string
set thePath to "PS 6.1:Productie:01 Bewerkte Quarkbestanden:" --Path to folder where you want to save the files.

repeat with i from 1 to number of items in the theFiles
	set thisFile to item i of the theFiles
	set thisFile to (theFolder & thisFile) as alias
	set theInfo to info for thisFile
	set fileName to the name of theInfo as text
	set typeOfFile to file type of theInfo as text
	if typeOfFile is in fileTypes then --Check if it is a Quark doc..
		tell application "QuarkXPress Passport"
				open thisFile use doc prefs yes remap fonts no do auto picture import no with reflow
				--Paste your actions here.
				save document 1 in (thePath & fileName)
				close document 1 --saving yes --(if you use saving yes after close doc 1 then delete the previous line.)
			end try
		end tell
	end if
end repeat

your save line includes a path. I’ll try that next.

Thank you

what about changing the version? i’m experimenting witha script in 10.3 to automate backsaving from Quark 6 to Quark 4, but i can’t get Quark 6 to change the file to version 5. Any thoughts? Tried recording the script, but had no luck.

Here’s what i have so far:

this opens the file fine and asks where to put it, but doesn’t actually save the file yet

I apologize in advance for my n00biness

Have you tried v50 instead of vers 50?