Change Text Preferences
hello
i have method changes text in text frame wish change first instance finds. @ moment changes finds.
is there prefernce setting changetextpreference.butjustthefirstonematey
or equivalent?
many thanks
mark.
please ignore c# , 'pretend' it's javascript.
private void changetextframetext(document doc, textframe targettextframe, string changetext, string changeto)
{
application indesignapp = (application)doc.parent;
indesignapp.findtextpreferences = idnothingenum.idnothing;
indesignapp.changetextpreferences = idnothingenum.idnothing;
findtextpreference ftp = (findtextpreference)indesignapp.findtextpreferences;
ftp.findwhat = changetext;
changetextpreference ctp = (changetextpreference)indesignapp.changetextpreferences;
ctp.changeto = changeto;
findchangetextoption fcto = (findchangetextoption)indesignapp.findchangetextoptions;
fcto.casesensitive = false;
fcto.includefootnotes = false;
fcto.includehiddenlayers = false;
fcto.includelockedlayersforfind = false;
fcto.includelockedstoriesforfind = false;
fcto.includemasterpages = false;
fcto.wholeword = false;
objects o = targettextframe.parentstory.changetext(false);
indesignapp.findtextpreferences = idnothingenum.idnothing;
indesignapp.changetextpreferences = idnothingenum.idnothing;
}
i don't think there prefrence like "changetextpreference.butjustthefirstonematey"
as per opinion replace code
objects o = targettextframe.parentstory.changetext(false);
with this
objects o = targettextframe.parentstory.findtext();
and list of array in o , replace o[0] output.
shonky
More discussions in InDesign Scripting
adobe
Comments
Post a Comment