I’m trying to move my Pocket content into DEVONthink Pro.
I imported a CSV to a DEVONthink sheet with the following columns:
URL
Title
Tags (multiple in one cell separated by commas)
The basic process would need a script that starts at the second row, creates a web archive from the URL, applies TITLE, adds TAGS, saves record to a group, repeat… My assumption is that importing various sorts of content via CSV with a method like this is a very common use case – most apps that allow users to export their content provide it as a CSV or JSON dump. However, despite trying a dozen searches with various phrases/terms, I haven’t come across any conversations here that address this. Am I missing something?
I have unsuccessfully played with this a bit using other community posts as inspiration, such as this one and this one.
tell application id "DNtp"
repeat with thisRecord in (selection as list)
if (type of thisRecord) = sheet then
set sheetData to (cells of content record of think window 1)
repeat with thisData in sheetData
try
set newRecord to create web document from (item 1 of thisData) in current group
set tags of newRecord to (item 2 of thisData)
end try
end repeat
end if
end repeat
end tell
Note the title is picked up by the process. If you want to use the title in the sheet, that’s certainly possible.
Also note commas are tag delimiters in macOS’ token fields now. This code is actually taking advantage of that to create separate tags without having to parse the tag column.
PS: This is not doing any URL validation, etc. It’s expecting valid URLs.
Hi, I’m new to DT—coming from Windows to Mac, with a handful of csv’s from other apps (pocket included) I’d like to import. Could you point me to some 101 information about how to use scripts like the one above? Thanks!