Copy link to clipboard
Copied
Hi All,
How to check the hyperlink status in CC2015 (red/green as per below highlighted).
Selva
Copy link to clipboard
Copied
Have you even tried looking at something ?
Copy link to clipboard
Copied
Hi Loic,
I have tried to read the properties, but can't find the status method. Guide to me
hyerlinkstatus();
function hyerlinkstatus(){
var d = app.documents[0];
var allHyperlinks = d.hyperlinks;
var myArr = new Array();
for(var n=0;n<allHyperlinks.length;n++){
myArr
for(var x in allHyperlinks
myArr
}
};
alert(myArr);
};
Thanks,
selva
Copy link to clipboard
Copied
Indeed, no properties or methods seem to actually return the hyperlink destination status as the panel does.
I hope I am wrong but if confirmed, then the solution might be to call command line and ping every single urls and analyze the result.
See doScript for that.
Copy link to clipboard
Copied
Well, in theory, you can send HEAD request through Socket connection, and check if response status code is 200 Ok
for example using this code
var site = "forums.adobe.com";
conn = new Socket;
if (conn.open (site+":80","UTF-8")) {
var request = "HEAD / \n\n";
conn.write (request);
var reply = conn.read(50);
conn.close();
//alert(reply);
var firstLine = reply.split("\n")[0];
var statusCode = firstLine.split(" ")[1];
var statusMsg = firstLine.split(/^.+\d{3}/)[1];
if(statusCode != 200) alert(site + " is not reachable:\n" + statusMsg);
}
The problem is that socket didn't work with https (or at least I don't know how) and many sites now use it...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now