how can I get around sips code throwing error's at long file names,

Hi All

I am using sips to convert .tif files to .pdf files, which is working quite well, apart from when the file names
are long, this is when sips throws an error.

Files named like 12345.tif & dg4tv.tif are fine, but when they look like this 12345_daytime_DLE_.tif
the code throws a wobbly with this error.

not a valid file - skipping Error 4: no file was specified.

is there a way to have the code process a file with any name?

on open theseItems
	set FileToLoad to POSIX path of theseItems --Get POSIX Path
	set NewFile to POSIX path of (path to desktop) --Get POSIX Path
	set posixInput to FileToLoad -- must be POSIX path
	set posixOutput to NewFile -- must be POSIX path
	do shell script "sips -s format pdf " & " " & posixInput & " --out " & posixOutput
end open

cheers

Are you sure it’s no spaces or quotes causing the problem. You should use quoted form like this:

   set FileToLoad to quoted form of POSIX path of theseItems --Get POSIX Path
   set NewFile to quoted form of POSIX path of (path to desktop) --Get POSIX Path

that was the problem, as you pointed out, I wasn’t using quoted form properly.

cheers Shane