Copy link to clipboard
Copied
Hello!
I'm trying to set the transparency grid to "Medium" when creating a new Illustrator document via ExtendScript, but I'm unable to get it working. According to the scripting documentation, the DocumentTransparencyGrid.TransparencyGridMedium constant exists, but I'm unsure of the correct property or method to use it with.
What I've tried:
var docPreset = new DocumentPreset(); docPreset.units = RulerUnits.Centimeters; docPreset.width = 368.504; // 13cm in points docPreset.height = 963.78; // 34cm in points docPreset.colorMode = DocumentColorSpace.CMYK; docPreset.transparencyGrid = DocumentTransparencyGrid.TransparencyGridMedium; var newDoc = app.documents.addDocument("Print", docPreset);
I've also tried setting it directly on the document after creation:
newDoc.transparencyGrid = DocumentTransparencyGrid.TransparencyGridMedium;
Question: Is it possible to set the transparency grid color programmatically in ExtendScript, and if so, what is the correct syntax?
Apologies if this is simple or I have missed something, I am not too familiar with ExtendScript.
Any help would be greatly appreciated!
Thanks!
Copy link to clipboard
Copied
Hi @freddie_1031 I did some quick testing and couldn't make that enum do anything. But my ignorance goes even further: I don't even know where to edit the Transparency Grid via the UI. Do you know?
I get the impression that Adobe might have deprecated it at some time and it doesn't do anything these days. Maybe someone knowledgeable will know...
- Mark
Copy link to clipboard
Copied
Tried it too, and indeed nothing happened.
This can be checked under the following conditions:
In the meantime, a workaround could be opening the file saved as a template (ait), but we probably want a fundamental solution.
Copy link to clipboard
Copied
Take a simple, empty Illustrator document, save it then change the extension to .txt.
When you open it, you'll have a list of settings, notably "%_1 /Int (AI9 transparency grid size)" — it's not an answer, but it might get you on the right track.
Copy link to clipboard
Copied
Hi @freddie_1031
Unfortunately, the transparency grid has not worked with a script for many years.
But perhaps you could open your new document based on a transparent document and change the “other” values.
var aDoc = documents.addDocument( "Film und Video", /*myPreset*/); // this is the German string
Copy link to clipboard
Copied
Hi @freddie_1031
Unfortunately, the transparency grid has not worked with a script for many years.But perhaps you could open your new document based on a transparent document and change the “other” values.
var aDoc = documents.addDocument( "Film und Video", /*myPreset*/); // this is the German string
By @pixxxelschubser
ohhhh dumb me, It didn't work with the German text Lol
I found one of my old notes, it does work, the english string should be "Film & Video"
Copy link to clipboard
Copied
Hi Carlos
😉
Does this help you find the string in your language more easily?
var presetsList = [];
for (i = 0; i < startupPresetsList.length; i++) {
presetsList[i] = [ i, startupPresetsList[i] ];
}
alert("Index list\r\r"+presetsList.join('\r'));
Copy link to clipboard
Copied
Hi pixxxel, I know the right string. I carelessly copied your same "as is", I didn't realize the preset was in German.
thanks
Copy link to clipboard
Copied
Hi all!
Unfortunately it's clear that it is not possible to change the transparency grid with ExtendScript. Thank you all so much for your replys!
Copy link to clipboard
Copied
If I understood correctly, what @Svija implied is that it used to work in older versions like v9?
it's clear it doesn't work now.
Copy link to clipboard
Copied
??
You can't change it, but you can set it with the ‘right’ template. Have you tried it (see my previous post)?
Copy link to clipboard
Copied
After a lot of testing, I have found that scripting is consistently useful only for manipulating the document, not the workspace.
It is not possible to expand layers, for example.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more