🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1517

Re: Give #10 increment to each index entry folios....

#1517
From: Dave_Saunders
Date: Thu, 05 Feb 2009 12:40
26 lines
1713 bytes
Does this work?

myIndex = app.selection[0].parentStory 
setupFindGrep("\\d+") 
myFinds = myIndex.findGrep(); 
for (var j = myFinds.length - 1; j >= 0; j--) { 
  myFinds[j].contents = String(Number(myFinds[j].contents) + 10) 
}

function setupFindGrep(find, change, foots, hidLayers, lockedLayers, lockedStories, masters) { 
  app.findGrepPreferences = null; 
  app.changeGrepPreferences = null; 
  try { app.findGrepPreferences.findWhat = find } catch(e) {}; 
  try {app.changeGrepPreferences.changeTo = change } catch(e) {}; 
  app.findChangeGrepOptions.properties = { 
    includeFootnotes:(foots == null ? false : foots), 
    includeHiddenLayers:(hidLayers == null ? false : hidLayers), 
    includeLockedLayersForFind:(lockedLayers == null ? false : lockedLayers), 
    includeLockedStoriesForFind:(lockedStories == null ? false : lockedStories), 
    includeMasterPages:(masters == null ? false : masters) 
  } 
} // end setupFindGrep

Be warned that I just wrote this here and haven't tested it. The function works correctly; that I lifted from my library of text snippets.

Dave
Technical Details
Message-ID: <59b7c9a2.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
References: <59b7c9a2.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,51aaf7605a8cc21d
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Dave_Saunders@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Give #10 increment to each index entry folios....
Message-ID: <59b7c9a2.0@webcrossing.la2eafNXanI>
Date: Thu, 5 Feb 2009 04:40:30 -0800
References: <59b7c9a2.-1@webcrossing.la2eafNXanI>
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit