Getting File Name & Print File Proble

Hi All
I am using QuarkXPress 6.5 & OSX.
I am using below code to store file name in a variable, but it shows me error.


tell application "QuarkXPress"
activate
set myDoc to the front document
tell myDoc
set FileName to get file name as string
display dialog FileName
print FileName file
end tell
end tell

Thanks

This should help. You only need “name” not “file name” and the print requires no reference inside the tell doc block.

tell application "QuarkXPress"
	activate
	set docName to name of document 1 as string
	display dialog docName
	set docName to items 1 thru 8 of docName as string
	display dialog docName
	tell document 1
		print -- In a tell doc block prints doc
		tell page 2
			print -- In a tell page block prints page
		end tell
	end tell
	print -- In a tell application block requires object Reference
end tell

:expressionless: Hi

Not working, quark quiting.

thanks