The purpose of this script (just a slightly modified copy of the bundled Creation > Modification Date.scpt) is to copy “DT-internal” URL metadata to the Comment field, preserving the URL in Spotlight Comments when the latter is copied to them when exporting documents.
-- URL > Comment.
tell application id "com.devon-technologies.thinkpro2"
try
set this_selection to the selection
if this_selection is {} then error "Please select some contents."
repeat with this_record in this_selection
set this_url to the URL of this_record
set the comment of this_record to this_url
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 tell
Btw, it’s not clear from the description of this subforum - Learn how to automate DEVONthink Pro - if it’s the intended place to post scripts.