Illustrator CS3 bleed offset

Hi all,
I have a script that saves Illustrator CS3 documents as PDF files. I do this using a preset but I would like to change the bleed offset depending on the text returned of a display dialog. Each time I specify a value for the bleed offset it seems to default the value to points rather than millimeters. My work around for this was to calculate the size 1 mm in points and then multiply that by the amount of bleed I want in mm e.g 2.835 * 3 = 8.505, the only problem is that Illustrator seems to round up the value I give it to an integer, and so I don’t get the exact result I’m after. I’ve had a look at Illustrators dictionary but I can’t seem to find a way of changing it so that Illustrator knows I’m talking about mm rather than pt. Does anybody know of a way of fixing this or have a work around or even understand my question???
Here is a short version of my code:

tell application "Adobe Illustrator"
	set the_container to (file path of document 1 as string)
	save current document in the_container as pdf with options {PDF preset:"AM_Hires_PDF", bleed offset:{3, 3, 3, 3}, view pdf:true}
end tell

Thanks,
Nik

I am kinda shooting in the dark, but have you tried setting the units to mm in your prefs? Just a guess…

Unfortunately hat doesn’t affect what bleed offset is looking for. I have a work around though. I worked out what 1mm would be in pt (2.83465), so then I multiply that by the text returned from t:/he dialog, then, using shell to cat a preset I’ve made that contains everything except the bleed I pipe that through sed to search for a value and replace it with the variable I’ve set from my dialog and then finally write that out to a temp file that I then just import into Illustrator.

property master_joboptions : (path to applications folder as string) & "Adobe Illustrator CS3:Presets.localized:Scripts.localized:master.joboptions"
property posix_path : quoted form of POSIX path of (master_joboptions as string)
property thefilepath : master_joboptions as string
property myoffset : offset of "master.joboptions" in thefilepath
property temp_joboptions_path : text 1 thru (myoffset - 1) in thefilepath & "temp.joboptions"
property posix_output_path : quoted form of POSIX path of temp_joboptions_path

tell application "Adobe Illustrator"
	set active_doc to document 1
	set the_container to (file path of document 1 as string)
	set placed_image_count to count every placed item of active_doc
	if placed_image_count > 0 then
		set the_question to display dialog "There are images in this document that are not embeded!" & return & "Would you like to embed images before saving as a PDF?" buttons {"No", "Yes"} default button "Yes" with icon 0
		if button returned of the_question is "Yes" then
			save current document in the_container as Illustrator with options {compatibility:Illustrator 13, compressed:false, embed ICC profile:true, embed linked files:true, font subset threshold:100, PDF compatible:true}
			my create_preset(the_container)
		end if
	else
		my create_preset(the_container)
	end if
end tell

on create_preset(the_container)
	tell application "Adobe Illustrator"
		set bleed_amount to text returned of (display dialog "Please enter bleed amount!" default answer "" with icon 2)
		set mychangevariable to 2.83465 * bleed_amount
		set replace_script to " | sed -e 's/mybleedvariable/" & mychangevariable & "/g' "
		do shell script "cat " & posix_path & replace_script & " > " & posix_output_path
		set temp_preset_alias to (path to applications folder as string) & "Adobe Illustrator CS3:Presets.localized:Scripts.localized:temp.joboptions"
		import PDF preset current document from file temp_preset_alias with replacing preset
		save current document in the_container as pdf with options {PDF preset:"temp", view pdf:true}
	end tell
end create_preset

Thanks for your response,
Nik