How di I use scripts?

Ask a Question related to Adobe Indesign Windows, Design and Development.

  1. #1

    Default How di I use scripts?

    I found a great paginating script, but I have no idea how to use it.

    Thanks (script below)

    myPages = app.documents[0].pages;

    // Let's make sure that the pages are a multiple of four
    app.documents[0].documentPreferences.allowPageShuffle = false;

    if (myPages.length % 4 != 0) {
    alert("Document length isn't a multiple of four.");
    exit();
    }

    for (i=0; myPages.length>i; i++) {
    origSection = myPages[i].appliedSection;
    origNumbering = origSection.pageNumberStyle;
    origSection.pageNumberStyle = PageNumberStyle.arabic;
    pageName = myPages[i].name;
    sectName = origSection.name;
    if (sectName != "") {
    pageName = pageName.split(sectName)[1];
    }
    pageNo = Number(pageName);
    newSection = app.documents[0].sections.add(undefined, undefined, {pageStart:app.documents[0].pages[i], continueNumbering:false, pageNumberStart:pageNo, pageNumberStyle:origNumbering});
    origSection.pageNumberStyle = origNumbering;
    }
    app.documents[0].documentPreferences.allowPageShuffle = true;

    for (i=0; (myPages.length/2)>i; i++){
    if (i % 2 == 0) {
    app.documents[0].pages[myPages.length - 1].move(LocationOptions.before,app.documents[0].pages[i*2],BindingOptions.leftAlign);
    } else {
    app.documents[0].pages[myPages.length - 1].move(LocationOptions.after,app.documents[0].pages[i*2],BindingOptions.rightAlign);
    }
    }
    Steve_Dorsey@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. php scripts
      Does anyone know of like some customizeable script that allows me to have one icon if there is a user logged in and another if nobody the user is not...
    2. CS: Scripts do not appear in Scripts menu
      I have several utility AppleScripts that I created for Illustrator 10. I'd like to use these in CS, and they work correctly when I choose "Browse"...
    3. Where should PHP scripts go?
      Hi folks, In developing a website containing both HTML files and PHP files, I had thought that it was good practice (or even mandatory depending...
    4. scripts that control other scripts
      Is there any behaviour script that when attached to a sprite can control the functionality of any other scripts attached to that sprite? I want to...
    5. ASP scripts from IIS 4 to IIS 5
      > Set objLog = objFile.OpenTextFile(Server.MapPath Do you have the Norton and/or McAfee Viruses (err, anti-virus products) installed?...
  3. #2

    Default Re: How di I use scripts?

    Since this is a javascript script, save it as a plain text file with the extension .js in your scripts directory, which is almost certainly C:\Program Files\Adobe\InDesign CS\Presets\Scripts. Open the Scripps palette (Window->Scripting->Scripts. The filename you saved the script under should be there. Double-click on that filename.
    Stu_Bloom@adobeforums.com Guest

  4. #3

    Default Re: How di I use scripts?

    Stu's advice on how to activate a JavaScript script posted like this in the forums is right on.

    In the case of this particular script, please also note the advice posted here: Dave Saunders "InDesign won't impose pages!?!" 5/5/04 10:21am </cgi-bin/webx?14@@.3bb3c172/6>

    The key points are:

    1. Work on a copy of your document.

    2. Be sure to activate the Spreads option in the print dialogs when printing (or exporting to PDF) the document that this script generates from your original.

    Dave
    Dave_Saunders@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139