Legend
August 31, 2025
Answered
Is there a way to detect whether the currently selected text box contains a frame separator?
- August 31, 2025
- 1 reply
- 291 views
I want to check whether the currently selected frame contains a frame separator (~R) or a page separator (~P).
But it seems like I'm not getting any results.
var s = app.selection[0].texts[0].contents;
alert(s);
var what = "~R|~P"
var res = getGrepSearch(what, app.activeDocument);
alert(res);
function getGrepSearch(fp, s) {
app.findGrepPreferences = app.changeGrepPreferences = app.findChangeGrepOptions = null;
app.findChangeGrepOptions.properties = { includeHiddenLayers: true, includeLockedLayersForFind: true, includeLockedStoriesForFind: true, includeMasterPages: true }
app.findGrepPreferences.findWhat = fp;
//return app.findGrep()
return s.findGrep()
}

