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

On 4/29/14 5:55 PM, Scott Prentice wrote:
Hi John...

Interesting.

First, you'd have to define what it means for a link to be "valid". Are these URLs to content on a web server? If so, does valid mean that it doesn't return a 404 error (page not found)? Or do you need to know that the page actually has the content that you expected it to .. in which case you might want to be able to scan the content at the target URL for text that matches the link text?

Or .. am I blowing this out of proportion, and you're just looking on a local file system for a matching file name?

If the latter, ExtendScript should be able to do what you need, if the former, you might need a bit more processing power like an FDK client.

I'll be interested to see if anyone else has done this sort of thing.

If you need help developing such a script/utility .. give me a holler.

Cheers,

...scott

Scott Prentice
Leximation, Inc.
www.leximation.com
+1.415.485.1892


On 4/28/14 12:11 PM, john.x.pos...@us.hsbc.com wrote:
Hi, guys...FM 11.

I have a section in my books that is just pages and pages of links to text,
sql, excel, and PDF files that are out on our Sharepoint system.

As we go forward, the links are becoming a maintenance issue. While I know
I cannot automate the creation of the links, I'd like to have something
that can validate my links.

Each link is defined as a "Go to URL" hyperlink and it is an absolute link,
not relative.

Has anyone done this kind of scripting?

Thanks

John X Posada
AML Syst & Ops Supt Data Analyst | US FCC & RC Systems Control & Analytics
| HSBC North America Holdings Inc
330 Madison Ave., NY NY
_______________________________________________________________ Phone
       Int: 212-525-5483 Ext: Personal cellphone - 732-259-2874
  Mobile
       Company Blackberry - 224-600-0570
  Email
john.x.pos...@us.hsbc.com _______________________________________________________________
  Protect our environment - please only print this if you have
  to!


-----------------------------------------
******************************************************************
This E-mail is confidential. It may also be legally privileged. If
you are not the addressee you may not copy, forward, disclose or
use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return E-mail.

Internet communications cannot be guaranteed to be timely, secure,
error or virus-free. The sender does not accept liability for any
errors or omissions.
******************************************************************
SAVE PAPER - THINK BEFORE YOU PRINT!
_______________________________________________




_______________________________________________


You are currently subscribed to framers as arch...@mail-archive.com.

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

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

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

Reply via email to