Help with a script error please...

Hi there,

I’ve put together a script to ‘downsave’ Quark 6 docs as Quark 5. The script runs as drag and drop, you drop the files on and off it goes. I’d written a more basic version of this script, that works, however there is no error handling.
I’ve then tried adding something that makes a note of any files that can’t be opened and writes that list to a LogFile.

The error I’m getting with the script is as follows:-

‘Can’t make file “QuarkXpress” of item 1 of {alias “G5MAC-9:Users:name:Desktop:NewDeal_cmyk_star_bg.eps”} into a string’

The file ‘NewDeal_cmyk_star_bg.eps’ is a test file.

I’ve a good idea why it’s doing this but not sure how I get round it.
I think the error is occuring near here:-


               set fileName to (file name of theitem) as text

Any help would be greatly appreciated, thanks in advance.

Nick

Here’s the script:-


on open (someitems)
	
	set LogFile to a reference to (path to desktop as string) & "errorList.txt"
	set savedTextItemDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {return}
	
	set fileList to {}
	
	tell application "QuarkXPress"
		
		activate
		
		repeat with theitem in someitems
			
			try
				
				open theitem as alias
				save document 1 in alias theitem version vers 50
				close document 1
				
			on error
				set fileName to (file name of theitem) as text
				set fileList to (fileList & fileName & return as text)
			end try
			
		end repeat
		
	end tell
	
	
	
	try
		open for access file LogFile with write permission
		set eof of file LogFile to 0
		write fileList to file LogFile
		close access file LogFile
		
	on error errText number errNum
		close access file LogFile
		display dialog errText
	end try
	
	set AppleScript's text item delimiters to savedTextItemDelimiters
	
	
	
end open


try changing the line in question to:

set fileName to (name of (get info for theitem))

-N

Thanks for that, the script works fine now. :slight_smile: