Skip to main content
Inspiring
May 5, 2021
Question

Scripting syntax

  • May 5, 2021
  • 3 replies
  • 3159 views

I'm having a lot of issues with the Javascript CS4 Scripting Reference for Illustrator. Not only is it full of typos, it is also not clear at times. For a case sensitive language, this is a headache.

For example, on page 45 for EPSSaveOptions properties:

-Is the correct syntax for a property like "overprint":

var saveOpts = new EPSSaveOptions();

saveOpts.overprint = PDFOverprint.PRESERVEPDFOVERPRINT;

or simply

saveOpts.PDFOverprint.PRESERVEPDFOVERPRINT;

 

-Also, in the Save As Illustrator EPS menu, there are various options under Transparency>Preset (and a window pops up with further parameters that can be set such as Raster/Vector Balance. Can those also be set via script?

 

Thanks.

This topic has been closed for replies.

3 replies

CarlosCanto
Community Expert
Community Expert
May 6, 2021

1. I did not find a way to set a different default preset.

2. You can create your own Preset. Go to Edit->Transparency Flattener Presets...but then see #1

3. See #2

4. I think it will, try it and let us know.

CarlosCanto
Community Expert
Community Expert
May 5, 2021

I don't think we have access to the Transparency Preset Settings via scripting, however you could potentially modify the presets file manually to change the values of the default preset.

 

In my computer the default preset is [Medium Resolution], try changing the values of the medium preset to whatever you need

/collection2 {
	/attributes {
		/collectionName [ 19
			5b4d656469756d205265736f6c7574696f6e5d
		]
		/AI10\ flattener\ outline\ text 0
		/AI10\ flattener\ outline\ strokes 1
		/AI10\ flattener\ clip\ complex\ regions 1
		/AI16\ flattener\ anti\ alias 0
		/AI10\ flattener\ raster-vector\ balance 75
		/AI9\ Output\ Rasterization\ Resolution 300.0
		/AI9\ Mesh\ Rasterization\ Resolution 150.0
	}
	/canEdit 0
	/canDelete 0
}

 

the file is located here

"C:\Users\canto\AppData\Roaming\Adobe\Adobe Illustrator 25 Settings\en_US\x64\Transparency Flattener Presets"

 

you might need to close illustrator before making any changes and make a back up copy of the original file

sPretzelAuthor
Inspiring
May 6, 2021

Hi Carlos,

Great information. Thanks. I was not aware of that. I looked at this file and have a few questions.

-Is there a way to see or set the default Transparency Flattener preset other than looking at what shows in the menu (in my case, it also appears to be Medium Resolution)?

-Rather than modify one of the presets in the file you mention (there are three in my case, called Collection1, Collection2, etc), is it possible to create a fourth collection where I define my own paramaters and set that as the default?

That being said, the collection name (High Resolution, Medium Resolution, Low Resolution) appears in a coded fashion in this file, as seen in the excerpt you showed. So how could I set a name for this new collection and the name would appear in the roll-down menu in the Transparency Preset window?

-Would restoring a backup file of this file reinstate everything correctly to its default state for sure?

Charu Rajput
Community Expert
Community Expert
May 5, 2021

Hi 

Correct syntax is

 

var saveOpts = new EPSSaveOptions();
saveOpts.overprint = PDFOverprint.PRESERVEPDFOVERPRINT;

 

 

See, example from page 46 to set options

Best regards
sPretzelAuthor
Inspiring
May 5, 2021

That was a typo on my end! Let me correct that in the initial post.

sPretzelAuthor
Inspiring
May 5, 2021

I could not find anything that we can do with script .

May be someone else has some way to do it.


Okay. Thanks for trying to help Charu.