Object style script

Explorer ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

Hello! Does anyone know how to change the code below from "Object Style 1" to the currently selected object style that's selected? So that I don't need to input the style name, but click on the object and it'll find the other objects that have the same object style applied.

 

var combineMe = new Array;
app.findObjectPreferences = null;
app.findObjectPreferences.appliedObjectStyles = "Object Style 1"
found_list = app.activeDocument.findObject();
for (a=0; a<found_list.length; a++) {
if (found_list[a] instanceof TextFrame) {
combineMe.push(found_list[a]);
}
}
 
Any help would be appreciated. Thank you!
TOPICS
How to, Scripting

Views

62

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
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Apr 18, 2021 Apr 18, 2021
See below.  app.findObjectPreferences.appliedObjectStyles = app.selection[0].appliedObjectStyle.name;

Likes

Translate

Translate
Adobe Community Professional ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

See below. 

app.findObjectPreferences.appliedObjectStyles = app.selection[0].appliedObjectStyle.name;

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
community guidelines
Explorer ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

LATEST

Thank you a ton!!

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
community guidelines