🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1547

[JS CS3] Function relink working but nof fully functional

#1547
From: loic_aigon
Date: Fri, 30 Jan 2009 09:15
26 lines
1526 bytes
Hi,
I wrote this function to update all my links as path were modified.
It runs well except that when I launch it, it let a few links not updated.
I need to relaunch and relaunch the script as long as necessary to get all links updated.
Is this a know issue ?

I run it as a loop call for any of my links
link is links[i]
name is the name of the broken link (ie : lostlink.tif)
newlink is the link to the new file (ie. /d/.../newlink.tif)
So for all links, it looks for the link status.
If it's not normal, it will check for the name of the link and look if it contains the name requested. In this case, it will relink the link to a new direction and update it.

function relinks(link, name, newlink)
{
	if(link.name.indexOf(name)>=0 && link.name.indexOf("/m/")==-1)
	{
		link.relink(File(newlink));
		link.update();
		link.parent.fit(FitOptions.PROPORTIONALLY)
		link.parent.fit(FitOptions.CENTER_CONTENT);
	}	
}

thanks for advice
Loic
Technical Details
Message-ID: <59b7bb60.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,d49ec414450d2d8,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: loic_aigon <loic_aigon@yahoo.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: [JS CS3] Function relink working but nof fully functional
Message-ID: <59b7bb60.-1@webcrossing.la2eafNXanI>
Date: Fri, 30 Jan 2009 01:15:56 -0800
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit