Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to use Symbol Options within a Script

Engaged ,
Dec 20, 2021 Dec 20, 2021

Good Morning,

 

I have a script that places a Symbol, but it recognizes it only as the "Number" of the Symbol.  ie if it is the 6th Symbol in my library of Symbols that I want to pull I set up my var as 

var symbolNum = 6;

 

Is there a way I can reference that symbol by the Name in the Symbol Options,

BryanPagenkopf_1-1640018507030.png

so that if I change the order of my symbols it still pulls the correct symbol?

 

Thank you!

TOPICS
Scripting
231
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Valorous Hero ,
Dec 20, 2021 Dec 20, 2021
LATEST

You can get the symbol by name like other items in Illustrator, with the 'getByName' method:

#target illustrator
function test(){
	var doc = app.activeDocument;
	var s = doc.symbols.getByName("DateField_over");
	alert(s.name);
};
test();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines