Find and replace text
This should be a simple and common question, but most posts I found linked back to this:
https://community.adobe.com/t5/framemaker-discussions/find-replace/td-p/3581679#4032650
I tried the script there and failed. Some things that would help hopefully:
I'm trying to replace one name at the end of a document in the main flow (in the last table of the document). So the script only has to start at the end and when it makes the first replacement or leaves the table, it is done.
From the linked thread, I tried to use (obfuscating a bit):
FindAndReplaceString(app.activeDoc,app.activeDoc.MainFlowInDoc,'CHARLES T . SMITH','JOHN Q. PUBLIC', 'True');
And I got "Undefined is not an object"
Second question. Currently this name is in plain text in our FM template.
I'm considering putting it in a user variable - maybe named _Signature.
Would the script still find and replace it if I did this?
Or -
I have a script which updates the document with the latest Master Page Formats, but it's been a while since I've looked at it. I have these lines in the script:
doc.SimpleImportFormats (New_Template, formatFlags);
function FixCopyrightDate(doc){var variable;variable = doc.GetNamedVarFmt ("Current Date (Long)");variable.Fmt = "<$year>";}// -- End Fix CopyrightDate
Could either of these be (easily) modifed to update ONLY _Signature without updated ALL the other user variables as well?
I could test the last two items, but the experts on here probably know instantly and I still need the solution to the initial question.
Disregard the strike-thru text - I'm pretty sure I can update the user variables.
Let me know if anything is unclear.
Thanks in advance!!!
