Extremely simple script fails to open Quark document

property newFileName : "MyDocument.qxp"
tell application "QuarkXPress"
	activate
	open file newFileName as file
end tell

This fails with a “Can’t make file of application QuarkXPress into a file.”

If I remove “as file” it fails with “Bad name for file. some object”

Where did “some object” come from? And what do I have to do to get Quark to open a file?

Thanks for any thoughts,
-Kurt

Kurt:

You need a valid file path. You are providing only a file name. You need something like “MyMac:Users:SomeUser:Desktop:MyQuarkDoc.qxd”. You may need to coerce it to an alias as well. I know QX 4.x you could “open newFileName as string”. If that doesn’t work then try “as alias”.

I’m curious as to why you are putting it in a property at the top of your script.

Jim Neumann
BLUEFROG