Article View: adobe.scripting.indesign
Article #1556Re: Update link - js assistance
From: Kasyan_Servetsky
Date: Fri, 30 Jan 2009 15:04
Date: Fri, 30 Jan 2009 15:04
43 lines
1724 bytes
1724 bytes
I use this function to check for modified/missing/embedded links. It finds and shows such links.
var myDoc = app.activeDocument;
checkLinkNormal();
function checkLinkNormal(){
for(var myCounter = 0; myCounter < myDoc.links.length; myCounter++){
var myLink = myDoc.links[myCounter];
if (myLink.status != LinkStatus.normal){
if (myLink.status == LinkStatus.linkOutOfDate){
myLink.show();
alert ("This link is modified.");
}
else if (myLink.status == LinkStatus.linkMissing){
myLink.show();
alert("This link is modified.");
}
else if (myLink.status == LinkStatus.linkEmbedded){
myLink.show();
alert ("This link is embeded.");
}
exit();
}
}
}
If we use your approach, we just get an error that some link, someware in the document is missing:
var myDoc = app.activeDocument;
try {
myDoc.links.everyItem().update();
}
catch(e) {
err(e);
}
function err(e){
alert(e);
exit();
}
Technical Details
Message-ID:
<59b7bbb3.3@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!news.glorb.com!newshub.sdsu.edu!webcrossingReferences:
<59b7bbb3.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,91cecb121be77b84 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Kasyan_Servetsky@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!news.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Update link - js assistance Message-ID: <59b7bbb3.3@webcrossing.la2eafNXanI> Date: Fri, 30 Jan 2009 07:04:32 -0800 References: <59b7bbb3.-1@webcrossing.la2eafNXanI> Lines: 33 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit