Article View: adobe.scripting.indesign
Article #9997Re: Sizing frames to fit content and content to fit frame
From: Peter_Kahrel
Date: Wed, 12 Jul 2006 13:40
Date: Wed, 12 Jul 2006 13:40
16 lines
1288 bytes
1288 bytes
Peter,
A simple script seems to do what you want. The example below assumes the graphic files to be in drive d:\ and a name change that adds new- in front of the file name (this is just an example, change can be anything). All images keep their size, whether or not they've been resized. The script works in ID3 and ID 4 (4.0.3), behaviour is the same. Work on masters as well. What is the global name change?
Peter
var path = '/d/'
gr = app.activeDocument.allGraphics
for( var i = 0; i < gr.length; i++ )
{
f = File( path + 'new-' + gr[i].itemLink.name );
gr[i].itemLink.relink( f );
gr[i].itemLink.update();
}
Technical Details
Message-ID:
<3bc0e2e8.6@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.motzarella.org!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc0e2e8.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,9d4e6a416f9d0ca7 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Peter_Kahrel@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: Sizing frames to fit content and content to fit frame Message-ID: <3bc0e2e8.6@webcrossing.la2eafNXanI> Date: Wed, 12 Jul 2006 06:40:01 -0700 References: <3bc0e2e8.-1@webcrossing.la2eafNXanI> Lines: 19 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.motzarella.org!news.ecp.fr!news.stben.net!webcrossing