Indesign print preset problem

I found this script, it makes a new printerpreset in Indesign with the name “PSfile”. But when I add set paper size to “Custom” the script fails. Altough paper size is in Indesign’s dictionary.

What am I doing wrong?

Edit: My mistake “Custom” isn’t supposed to stand between brakets. So my problem is solved. Sorry

I’m going to guess that since your preset is names “PSfile” that you are not making a printout to a printer but printing to a PS file on the computer. Some setting you have does not allow a custom page size. I just experimented and, doing it manually, the custom page size is greyed out for most PPDs when using the print to postscript file setting. It is available if you set the PPD to “AdobePDF 7.0” or “AdobePDF 8.0” (whichever you have). That’s how I have it set up in one of my scripts.

Hope that helps!

tell application "Adobe InDesign CS3"
	activate
	tell active document
		tell print preferences
			set printer to postscript file
			set PPD to "AdobePDF 8.0"
			set print file to PS_file_path_variable
		end tell --end tell print prefs
	end tell --end tell active doc

Model: G5 OSX 10.4.8
Browser: Safari 419.3
Operating System: Mac OS X (10.4)