InDesign 2.0 - Export PDF script not working

Can anyone offer any insight as to why this script won’t work?

tell application "InDesign"
	set properties of PDF export preferences to {grayscale bitmap sampling:downsample, color bitmap sampling:downsample, monochrome bitmap sampling:downsample, color bitmap sampling DPI:72, grayscale bitmap sampling DPI:72, monochrome bitmap sampling DPI:300}
	tell document 1
		export format PDF type to ("Desktop:" & name & ".PDF") without showing options
	end tell
end tell

I keep getting:
InDesign got an error: Can’t make “Desktop:Untitled-8.PDF” into type «class kfil».

Thanks for any help,
slimjim5811

Hi slimjim

I think the problem was with just where you were exporting to.
you didn’t specify a full path.

tell application "Adobe InDesign CS2"
	set x to name of document 1
	set FilePath to (path to desktop folder) & x & ".PDF" as string
	set properties of PDF export preferences to {grayscale bitmap sampling:downsample, color bitmap sampling:downsample, monochrome bitmap sampling:downsample, color bitmap sampling DPI:72, grayscale bitmap sampling DPI:72, monochrome bitmap sampling DPI:300}
	tell document 1
		export format PDF type to FilePath without showing options
	end tell
end tell

pidge -
I knew it had to be something easy I was leaving off. It always is!

Thanks for your help!
slimjim