Hello -- I have a giant publication that contains hundreds of hypertext markers that contain codes that change yearly. FM can find based on the code, but the change option pastes the new code into the body instead of at the end of the hyperlink as it should.
I can make the change after exporting to html5, but isn't there a way I can efficiently do it in the source files?
Thanks in advance ...
To the best of my knowledge, FrameMaker does not provide S&R capabilities within any of the various markers. However, you might want to get in touch with Silicon Prairie Software. The IndexTools Pro plugin is used to create index markers based on text included in a document that has a special format and condition; it can also expand existing Index markers into that text. It might be adaptable to hypertext markers, and Steve does do custom work. I don't know what his rates are, though.
Yes, good tip.
Silicon Prairie`s Index Tools Pro plugin inserts the marker text as regular text. Therefore you can work with variables, search and replace text and apply conditions.
You can test the plugins before you buy.
This is a perfect job for ExtendScript. And it would not require much code. The following simple script function will search all markers in the active document and replace the FindMe value with the ReplaceMe value. It is case-sensitive but it doesn't need to be.
var searchString = "FindMe";
var replaceString = "ReplaceMe";
var markersAdjusted = 0;
var doc = app.ActiveDoc;
alert("No active document. Cannot continue");
var marker = doc.FirstMarkerInDoc;
var text = marker.MarkerText;
var index = text.indexOf(searchString);
if(index > -1)
text = text.substring(0, index) +
text.substring(index + searchString.length, text.length);
marker.MarkerText = text;
marker = marker.NextMarkerInDoc;
alert("Operation complete. " + markersAdjusted + " markers adjusted.");
Hope this helps.
This is fantastic Russ, thanks! I do confess that I'm unfamilar with extendscript, but can work with java, which it looks identical to. Can you please let me know where I execute this from or point me to a good tutorial?
You can find lots of samples for beginners here:
To answer your immediate question, you should be able to just:
1 - Select File > Script > New Script.
2 - In the ExtendScript toolkit editor, you should get a blank script file. Paste the script I gave you into that file.
3 - Because the code I gave you is encapsulated in a function, you'll need to add the following line to the beginning of the file to execute it:
4 - Make sure the desired file is open in FrameMaker and click the Run button in the editor.
Note that you need to have FM2019 fully updated for this to work. There was a bug in the initial release version where the File > Script > New Script command did nothing.
Hope this gets you somewhere.
You, sir, are the MAN!
Worked perfectly. FM19 stil didn't open a new script at the command even after updating, but I just installed the extend script toolkit, linked it to FM19 and ran it from there. Thanks so much for introducing me to a whole new world ... I'm going to have some fun with this!
Mike, in my opinion, the ability to customize FrameMaker is one of its strongest differentiators in the marketplace. That along with its structured interface. So many people whine and complain about how "it doesn't do this" or "it doesn't do that" when in reality it can do whatever you want it to. Then when you suggest a little bit of scripting, they make a rock-solid commitment against learning anything new. It's an odd thing. But that is just a mini rant to buffer my main point, which is that I'm glad you were willing to give it a chance. ExtendScript really is not that hard and you are missing out on so much without it. Indeed it is fun... I hope that you dive in. Stop by here if you have questions, because the documentation is imperfect and even experienced developers sometimes have to ask for help.
As another thought, you MIGHT be able to do this by saving the files out to MIF, editing the link in the MIF, and then converting back to Frame.