URL Checker

Rick Quatro rick at rickquatro.com
Wed Apr 30 12:50:18 PDT 2014


Hi Russ,

Thanks for including me in your response. I wasn't aware of the Socket
object, but I just tried your script and it works great! This opens up
possibilities for some interesting applications. Thanks again.

Rick Quatro
Carmen Publishing Inc.
585-366-4017
rick at frameexpert.com




-----Original Message-----
From: framers-bounces at lists.frameusers.com
[mailto:framers-bounces at lists.frameusers.com] On Behalf Of
russ at weststreetconsulting.com
Sent: Wednesday, April 30, 2014 3:30 PM
To: framers at lists.frameusers.com
Subject: Re: URL Checker

John and Scott (and Rick),

I have a sample ExtendScript that uses the Socket object, called
"NETWORK_-_Retrieve_text_over_network.jsx". It retrieves text from a webpage
and sticks it into a document. It could be easily modified to just look for
the 200 OK message. All in all, this would be a very short and generally
simple script for an experienced developer. A great idea for a script,
really. I should add it to the group. I could use it myself.

http://www.weststreetconsulting.com/WSC_ExtendScriptSamples.htm

Russ




------------------------------

Message: 16
Date: Wed, 30 Apr 2014 09:46:55 -0700
From: Scott Prentice <sp10 at leximation.com>
To: john.x.posada at us.hsbc.com, framers
Subject: Re: URL Checker
Message-ID: <536128FF.2060704 at leximation.com>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

You got me thinking about this. Here's some really basic ExtendScript code
that will iterate over all markers and check the text of "message URL"
Hypertext markers to see if they are valid files (on the local file

system). This would need to be cleaned up a bit to make it useful, but
definitely doable ..

var doc = app.ActiveDoc;
var marker = doc.FirstMarkerInDoc;
while (marker.id) {
 if (marker.MarkerTypeId.Name == "Hypertext") {  var markerText =
marker.MarkerText;  if (markerText.substr(0,11) == "message URL") {  var
target = markerText.substr(12);  // tests for local files  var file =
File(target);  if (file.exists) {  Console("GOOD ["+target+"]");  } else {
Console("BAD ["+target+"]");  }  }  }  marker = marker.NextMarkerInDoc; }

It turns out that you can test for remote (web-based) URLs using the Socket
object.

Cheers,

...scott


_______________________________________________


You are currently subscribed to framers as rick at rickquatro.com.

Send list messages to framers at lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscribe at lists.frameusers.com
or visit
http://lists.frameusers.com/mailman/options/framers/rick%40rickquatro.com

Send administrative questions to listadmin at frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.




More information about the framers mailing list