Legend
June 18, 2026
Answered
Why can't I detect the target style in the group?
- June 18, 2026
- 2 replies
- 26 views
I want to check if the 'myPar' paragraph style exists.
When it is in the group, return true
But when it is within a certain group, it is not recognized.
Where is the problem?
var ifStyEx = styleExist("myPar", "allParagraphStyles")
//Check if the style exists
function styleExist(stn, astc) {
var d = app.activeDocument;
for (var i = 0; i < d[astc].length; i++) {
if (d[astc][i].name == stn) {
//style = d[astc][i];
//break;
return true;
}
else {
return alert("No exist");
}
}
}


