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

how to set the customShapeTool's shape name?

Engaged ,
Jul 22, 2019 Jul 22, 2019

Copy link to clipboard

Copied

hello,

    

    as is shown, how to set the customShapeTool's shape name?

QQ截图20190722194808.png

There's a piece of code here that doesn't work,Please help me.

// select tool 

var r = new ActionReference(); 

r.putClass(stringIDToTypeID("customShapeTool")); 

var d = new ActionDescriptor(); 

d.putReference(stringIDToTypeID("null"), r); 

executeAction(stringIDToTypeID("select"), d, DialogModes.NO); 

 

 

 

// set option  

 

var r = new ActionReference(); 

r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool")); 

r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum")); 

 

var ret = executeActionGet(r); 

 

var options = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));            

var options = options.getObjectValue(stringIDToTypeID("customShape"));  

options.putString(stringIDToTypeID("name"),"箭头 5");

var r = new ActionReference();  

r.putClass(stringIDToTypeID("customShapeTool"));

var d = new ActionDescriptor(); 

d.putReference(stringIDToTypeID("null"), r); 

d.putObject(stringIDToTypeID("to"), stringIDToTypeID("null"), options); 

executeAction(stringIDToTypeID("set"), d, DialogModes.NO); 

TOPICS
Actions and scripting

Views

1.0K

Translate

Translate

Report

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

correct answers 1 Correct answer

People's Champ , Jul 22, 2019 Jul 22, 2019

var r = new ActionReference();

r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));

r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

var options = executeActionGet(r).getObjectValue(stringIDToTypeID("currentToolOptions"));          

var d1 = new ActionDescriptor();

d1.putString(stringIDToTypeID("name"),"Arrow 5");

options.putObject(stringIDToTypeID("customShape"), stringIDToTypeID("customShape"), d1);

var r = new Act

...

Votes

Translate

Translate
Adobe
People's Champ ,
Jul 22, 2019 Jul 22, 2019

Copy link to clipboard

Copied

var r = new ActionReference();

r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));

r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

var options = executeActionGet(r).getObjectValue(stringIDToTypeID("currentToolOptions"));          

var d1 = new ActionDescriptor();

d1.putString(stringIDToTypeID("name"),"Arrow 5");

options.putObject(stringIDToTypeID("customShape"), stringIDToTypeID("customShape"), d1);

var r = new ActionReference();

r.putClass(stringIDToTypeID("customShapeTool"));

var d = new ActionDescriptor();

d.putReference(stringIDToTypeID("null"), r);

d.putObject(stringIDToTypeID("to"), stringIDToTypeID("null"), options);

executeAction(stringIDToTypeID("set"), d, DialogModes.NO);

Votes

Translate

Translate

Report

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
Engaged ,
Jul 22, 2019 Jul 22, 2019

Copy link to clipboard

Copied

LATEST

thank you ,r-bin,You are a warm-hearted person

Votes

Translate

Translate

Report

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