Clutter-free option for viewing web pages

DT offers the option of capturing/importing pages in “clutter-free” format. But it would be nice to be able to click a button and convert a web page one is reading into a clutter-free version of itself, without having to save it, rather like the “Reader” view in Safari. Have I missed it and this is already possible? Or is this a feature that could be added?

2 Likes

It’s not currently possible. The request is noted but it currently involves passing data through another mechanism so it may not be very performant.

Is the decluttering action scriptable? Or is there any way to declutter more than one document at a time?

This would be super useful!

The AppleScript commands “create PDF/web document from” support the clutter-free layout, see “readability” parameter. There’s a also a command “create Markdown document”, in this case the document is always using this layout.

@cgrunenberg As someone who is new to DEVONthink and a novice applescripter, can I talk you into spelling out how to use the readability parameter in an example? I see the parameter listed in the applescript library, but I don’t understand how to use it.

I prefer to capture websites through the web-clipper extension as formatted notes using the clutter-free option, and I was hoping to do this through an applescript that I could launch via Alfred. I’d also like to add a tag called “web clipping” and send it to the general inbox. I found a few posts in this forum about each of these elements, but none that I’ve been able to get to work (with these settings and my limited knowledge).

For example, how could I modify the following script, so that it adds the “web clipping” tag and uses the clutter-free option?

tell application "Safari"
	set pURL to URL of current tab of window 1
end tell

tell application id "com.devon-technologies.think3"
	create formatted note from pURL
end tell

Thanks for your help!

Have you checked DEVONthink’s AppleScript dictionary?

tell application "Safari"
	set pURL to URL of current tab of window 1
end tell

tell application id "DNtp"
	set newRecord to create formatted note from pURL in incoming group with readability -- This targets the Global Inbox
	set tags of newRecord to {"web clipping"}
end tell

Also have you reviewed the built-in Help > Documentation > Automation chapter? There is a lot of useful information in it, as well as on these Forums.

1 Like

Thanks a ton, @BLUEFROG! It works perfectly.

Yes, I tried digging through the manual first. Oddly enough, I got surprisingly close with another iteration of the script that I didn’t post above (because it didn’t work at all). Admittedly, I didn’t understand what the AppleScript dictionary meant by “boolean”. I tried a True, False, 1, 0, and bunch of other stuff :man_facepalming: … Still learning … Ha

Thanks again!

Yeah, it’s be nice if the dictionary gave examples of actual code. (Love how the PHP online docs do that.)

Actually if you type readability true, it works but will resolve to with readability when it compiles. This is true - no pun intended - of most boolean parameters in AppleScript.

That’s actually fairly uncommon in most AppleScript / JXA dictionaries. Just a side note.