Copy link to clipboard
Copied
When I search and replace text in a specific text box I have to make it bigger since I can´t get it to replace overset text.
Is it possible or do you do the same?
Copy link to clipboard
Copied
That is correct; if you use changeText on a text frame, it only works on what's visible.
But it should be possible to use the same changeText on the entire story in that text box (yourFrame.stories[0]) -- that will include overset text.
Copy link to clipboard
Copied
textFrame.stories doesn´t seem to work, only application has stories as far as I can tell. But it does work to loop the paragrahs of the textframe and it seems to be fast enough for me.
var my_frame = app.documents[0].selection[0];
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = "find";
app.changeTextPreferences.changeTo = "replace";
for(i = 0; i < my_frame.paragraphs.length; i++) {
my_frame.paragraphs.changeText();
}
Copy link to clipboard
Copied
You need to use my_frame.parentStory instead of my_frame.stories.
Here is working code.
var my_frame = app.documents[0].selection[0];
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat = "find";
app.changeTextPreferences.changeTo = "replace";
my_frame.parentStory.changeText()
Shonky
Copy link to clipboard
Copied
Of course
Each story can have multiple text frames but each frame can only be associated with one single story ... (I should have checked the Help.)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now