Hi all,
I’m poking my way through a script that should - were it to work - pull down Markdown versions of items in an RSS feed. It’s everyone’s holy grail, the cached copy of your Instapaper feed - though I’d imaging a (working) version of this script would find all manner of uses.
The code is:
on triggered(theTriggeredItem)
tell application id "com.devon-technologies.thinkpro2"
set theSelection to (children of theTriggeredItem)
if theSelection is not {} then
try
repeat with theRecord in theSelection
set theURL to the URL of theRecord
set theName to the name of theRecord
if theURL begins with "http:" or theURL begins with "https:" then
if label of theRecord is not 7 then
set theGroup to parent 1 of theRecord
set theCopy to create Markdown from theURL
-- set creation date of theCopy to creation date of theRecord
set the name of theCopy to the theName
-- set the label of theCopy to label of theRecord
-- set the state of theCopy to state of theRecord
set the tags of theCopy to tags of theRecord
-- set creation date of theCopy to creation date of theRecord
-- set modification date of theCopy to modification date of theRecord
set the label of theCopy to label of theRecord
set the label of theRecord to 7
end if
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end if
end tell
end triggered
The error I get from DEVONthink is
This is the name of one of the items in my Instapaper RSS feed, an article from The Guardian.
(I’m using label 7 as ‘archive’, so I can skip over pre-archived items in the feed).
Any smarter people with suggestions, critiques, or better still - fixes - welcome to join in the fray!
TIA
Dave