Skip to main content
terryc31486245
Participant
June 4, 2018
Answered

InDesign Cross Reference formats - define a format for use by any indd file

  • June 4, 2018
  • 1 reply
  • 484 views

Hello -

Am using Creative Cloud InDesign, whatever the latest version is.

I know how to modify/define a cross reference format while in a document.

However, I want to ADD a permanent format that can be accessed by ANY indd file, and I am hoping I don't need to do some kind of importing with each new indd file I am editing. I simply want the new format to be part of the list that pops down as you choose your format.

In my case, the format  I need is insanely simple: I just want the page number!, not "page x", just "x". I know how to do this once I am inside a document, but I work with HUNDREDS of documents, and can't manually add this format to each one. I have yet to find a way to either permanently modify an existing format, or better yet, create a new version, and have it show up regardless of which INDD file I am working on.

I read on a website that it can be done, by defining a new format with no documents loaded in InDesign. Nope - all options to define a format are greyed out, no access. Either the author was misinformed, or perhaps the version I use does not support this? or, I need some other option/plug-in that supports this?

Can this be done?

Thanks in advance,

Terry.

    This topic has been closed for replies.
    Correct answer TᴀW

    Looks like you've covered all bases. There indeed doesn't seem to be a way to set up a default cross-reference format. The closest you can do is load it up from a different document each time.

    So, the alternative would be a script. If you really want full automation (that it should just be there), it would need to be a startup script that gets triggered whenever a new document is opened.

    But even a plain old script can speed things up. Assign a shortcut key to the following (after saving it, from a text editor, with a .jsx extension, and placing in InDesign's Scripts Panel folder), and then you've got your page number x-ref at the press of a button, just one click per document:

    var CRFName = "Just the page number";

    if (!doc.crossReferenceFormats.itemByName(CRFName).isValid){

       with (doc.crossReferenceFormats.add(CRFName)){

          name = CRFName;

          buildingBlocks.add(BuildingBlockTypes.PAGE_NUMBER_BUILDING_BLOCK);

       }

    }

    HTH,

    Ariel

    1 reply

    TᴀW
    TᴀWCorrect answer
    Legend
    June 4, 2018

    Looks like you've covered all bases. There indeed doesn't seem to be a way to set up a default cross-reference format. The closest you can do is load it up from a different document each time.

    So, the alternative would be a script. If you really want full automation (that it should just be there), it would need to be a startup script that gets triggered whenever a new document is opened.

    But even a plain old script can speed things up. Assign a shortcut key to the following (after saving it, from a text editor, with a .jsx extension, and placing in InDesign's Scripts Panel folder), and then you've got your page number x-ref at the press of a button, just one click per document:

    var CRFName = "Just the page number";

    if (!doc.crossReferenceFormats.itemByName(CRFName).isValid){

       with (doc.crossReferenceFormats.add(CRFName)){

          name = CRFName;

          buildingBlocks.add(BuildingBlockTypes.PAGE_NUMBER_BUILDING_BLOCK);

       }

    }

    HTH,

    Ariel

    id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
    terryc31486245
    Participant
    June 4, 2018

    Thanks Ariel - awesome idea - If I can "import" the format quickly (via a start up script, that would definitely do the trick.

    I don't know much about the script capabilities in InDesign, but am very familiar with VBA in Microsoft products, so might be able to pick this up.

    I think I understand what your script does: check to see if "Just the page number" exists, if not add it...." but,  I am not clear how it knows  a) what the new format will be, or b) where the script can find an existing format, and import it.

    Or, more likely, I am missing the main point of your script.   lol

    By the way, outside of this issue, would there be a way, via an script,  to "quickly" load a bunch of files into a "Book", in a specific order? I have many documents with up to 21 "chapters" (different indd files), and I have to manually load them now, in a specific order...total pain and waste of time, but necessary. In VBA I could write such a mini-script/program. but that doesn't help here!

    Any ideas where to go to learn about scripts and the language they accept?

    Thanks in advance

    tc

    terryc31486245
    Participant
    June 4, 2018

    oh! I think I see it now:

    buildingBlocks.add(BuildingBlockTypes.PAGE_NUMBER_BUILDING_BLOCK);

    so...I'm guessing that ".PAGE_NUMBER_BUILDING_BLOCK"  phrase is the code that calls  just the page number...

    I was thinking there would be some kind of code like: format =  <pageNum />

    thanks

    Terry