🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1113

Re: Positioning Inline images? [CS3 JS WIN]

#1113
From: Peter Kahrel
Date: Tue, 17 Feb 2009 10:23
32 lines
1549 bytes
The good old days, eh, Harbs? Here's a CS2 version. It skips footnotes (because you can't do this kind of thing in footnotes in CS2) and tables.

Peter



#target indesign

picture_dir = '/d/' 
app.findPreferences = app.changePreferences = null; 
myStories = app.activeDocument.stories; 
for (i = 0; i < myStories.length; i++) 
   { 
   picnames = myStories[i].contents.match (/@.+?@/g); 
   if (picnames != null) 
      { 
      for (j = 0; j < picnames.length; j++) 
         { 
         found = app.activeDocument.search (picnames[j],false,false); 
         for (k = found.length-1; k > -1; k--) 
            { 
            try 
               { 
               filename = found[k].contents.replace (/@/g, ""); 
               found[k].insertionPoints[-1].place (File (picture_dir + filename)); 
               found[k].remove(); 
               } 
            catch(_){} 
            } 
         } 
      } 
   }
Technical Details
Message-ID: <59b7e7c8.7@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
References: <59b7e7c8.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,af274cf8762a4d09
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Peter Kahrel" <kahrel@kahrel.plus.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Positioning Inline images? [CS3 JS WIN]
Message-ID: <59b7e7c8.7@webcrossing.la2eafNXanI>
Date: Tue, 17 Feb 2009 02:23:23 -0800
References: <59b7e7c8.-1@webcrossing.la2eafNXanI>
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit