error -1728

Hallo,
I’m trying to create a script to convert image to jpeg with graphic converter.

This is my script:

on adding folder items to this_folder after receiving these_items
try
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items

		tell application "GraphicConverter"
			launch
			set test to this_item as alias
			open test as alias
			save test as JPEG with makeCopy
			close test
		end tell
	end repeat
on error errorMsg number errorNum
	display dialog "Error (" & errorNum & ")" & return & return & errorMsg buttons {"Cancel"} default button 1 with icon caution
end try

end adding folder items to

But I have a problem:
it display an error -1728: Graphic converter can’t obtain alias of "HDG5 … " blabla and the name of my file.

Where is the problem?
Why GC can’t obtain the alias of file??

THanks

I was messing around and came up with this:

on adding folder items to this_folder after receiving these_items
	repeat with i from 1 to (count of these_items)
		tell application "GraphicConverter"
			open item i of these_items
			tell window 1
				save it in (path to desktop as string) & (i as string) & ".jpg" as JPEG
				close
			end tell
		end tell
	end repeat
end adding folder items to

I hope that gives you a starting point… :smiley:

–Tom