find dead links

Never mind… I just found the “Invalid URL” group - thanks very much…

Nice gem.
Thanks @cgrunenberg!
Made it a Smart Rule on a weekly basis and added flagging to broken bookmarks
A “musthave” script

DEVONthink 3 include already a similar script for smart rules, see action Execute Script > External > Check Links.

2 Likes

I can’t seem to find this Check Links script in the Script menu. Is it still there?

It’s a script for smart rules (see Execute Script action) but not available via the Scripts menu.

Found it, thanks!

Although I’m not sure what it means when it says it’s updated the URL.

if the original URL gets redirected, then the script sets the destination URL of the redirects.

1 Like

I must be missing something - I don’t see it in my options ?

image

I’m using the latest version of DT.

My fault, it’s actually not part of the latest releases anymore as there’s now a “Check Bookmark” action. This action is a lot faster than the script and performed in the background.

Confirmed - I can see it now. The help file needs to be updated to reflect this.

Help > Documentation > Appendix > Smart Rule Events and Actions > Actions

1 Like

Christian, Jim - thanks!

May I ask two questions related to this, please:

  1. the help docs say of that Action …Check Bookmarks: Checks the URL of the matched items. Any issues with the URL are reported in the Log window or the Log popover…. what exactly does that do? Anything similar to the above-mentioned script’s ≥ 400 and 403 but neither 405 yet neither 404 nor containing 'github.com/' etc? I added ‘Display alert’ steps both before and after checking and they display almost instantaneously… does ‘Check Bookmarks’ actually perform HTTP validation?

  2. is there a way to run such validation on webarchives?

Thanks!

  1. Yes, the script validates the URL by calling it and checking the response.
  2. Yes, this will check the URL listed in the Info pane.

Thanks, Jim! Great for #1. I should have known :slight_smile: .

But for #2 (webarchives), I’m a little puzzled: I have a webarchive (in DT 3.7) whose correct URL is https://www.alamy.com. If I change the URL (in DT) to https://www.alamx.com (replace the final ‘y’ with an ‘x’) in Safari I get a 404 of course.

In DT I created a Smart Group (not necessary as I also do that in the Smart Rule itself) to look for any URLs containing ‘alamx’ (“Kind is Web Archive” + “URL contains alamx”).

Select the resulting item in the Info pane → right click → Apply Rules:

But nothing seems to happen.

I know the answer will be simple… :slight_smile: .

What is shown in Window > Log or the Log popover fro the toolbar button?

Yes, that was where I was expecting to see something - from Help > Documentation > Appendix > Smart Rule Events and Actions > Actions…

But nothing:

Then the URL is valid.

You would have thought so, wouldn’t you, Jim. But https://www.alamx.com is definitely not valid :frowning: .

In fact this is my latest edit of that Smart Rule - including the failed attempt to launch the URL; fails with a 404.

Maybe webarchives themselves as such can’t be validated after all?

Perhaps there’s a workaround?

Thanks!

Hello again, Jim - still can’t get link checking webarchives to work. This time (per the attached grab) I:

  1. clipped a webarchive of https://www.devontechnologies.com; Global Inbox
  2. changed the URL’s name to https://www.devontechnology.com
  3. applied the rule which detects any webarchive containing ‘devon’

Although the ‘Launch URL’ step failed as expected, the Smart Rule appeared to suggest that the webarchive’s address (https://www.devontechnology.com) was valid - even though that domain doesn’t exist. Nothing in the log!

Maybe I’m not understanding what Check Bookmarks really does?

TIA :slight_smile:

The methods with the “Check Bookmarks” didn’t work for me, but the Applescript as mentioned above works perfectly. Thanks @cgrunenberg!

1 Like