Highlighted

How to use script to set clone Stamp Tool options?

Explorer ,
Aug 10, 2020

Copy link to clipboard

Copied

How to use script to set clone Stamp Tool options?

 

I tried to use the following code, but it didn't work

 

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.putBoolean(charIDToTypeID('Algd'), true);

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

var r = new ActionReference(); 

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

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

41

Likes

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

How to use script to set clone Stamp Tool options?

Explorer ,
Aug 10, 2020

Copy link to clipboard

Copied

How to use script to set clone Stamp Tool options?

 

I tried to use the following code, but it didn't work

 

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.putBoolean(charIDToTypeID('Algd'), true);

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

var r = new ActionReference(); 

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

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

42

Likes

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
Aug 10, 2020 0

Have something to add?

Join the conversation