Copy link to clipboard
Copied
Hi veryone,
How can I change my Register-Page from "–" to "f" or "ff"?
InDesign makes:
Theme 1 . . . . . . . . 10–11
Theme 2 . . . . . . . . 12–19
I want it to be:
Theme 1 . . . . . . . . 10f
Theme 2 . . . . . . . . 12ff
Thank you so much
Copy link to clipboard
Copied
Simplistically, with this Script:
/*
_FRIdNGE-0747_IndexPagesF-FF.jsx
Script written by FRIdNGE, Michel Allio [15/12/2023]
*/
app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Index Pages F-FF! …");
function main()
{
// Place the cursor inside the Index Story
var myIndexStory = app.selection[0].parentStory;
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\d+–\\d+";
myFound = myIndexStory.findGrep();
for ( var i = myFound.length-1; i >= 0; i-- ) {
if ( Number(myFound[i].contents.split("–")[1]) == Number(myFound[i].contents.split("–")[0]) + 1 ) myFound[i].contents = myFound[i].contents.split("–")[0] + "f";
else myFound[i].contents = myFound[i].contents.split("–")[0] + "ff";
}
app.findGrepPreferences = app.changeGrepPreferences = null;
alert( "Done! …" )
}
(^/) The Jedi
Copy link to clipboard
Copied
I'll try it, thank you so much