Copy link to clipboard
Copied
Hi all,
I'm writing a script that enables/disables a layer as a Template layer.
In the Illustrator scripting reference (2017), I see the properties and methods I can access for Layer objects.
It states other booleans such as 'printable', but not 'template' or 'isTemplate' which are accessible (not read-only).
Is it possible to set/unset a layer as template layer through script?
Copy link to clipboard
Copied
It does not look like the template property is listed in the scripting commands, but you can record a dynamic action to play, which could make a new template layer with your settings you desire.
Writing a dynamic action is just one of those things us Illustrator scripters have to do in order to work around Illustrator scripting's limitations or bugs!
Creating a dynamic action to use with app.doScript() method.
Copy link to clipboard
Copied
I see.
Do I understand correctly if the doScript method is only available if the Illustrator script is in VB?
Mine is in javascript (currently) and neither can I find a reference to doScript in the scripting reference.
Meaning I should convert my script to VB to use doScript?
Copy link to clipboard
Copied
you can use app.doScript() in javascript with no problem. The only limitation is that you must be using Illustrator CS6 or above