I’ve modified a script by Korm to do that. Just set your choosen delimiter in the property at the top.
Careful: if the delimiter is on a line by its own you need to add the return at the end as well!```
– Explode a document into multiple documents
– Place the exploded pieces into a group
– Link the original (unexploded) document to that group
– Adapted by alastor933 from a script by Korm
– Explode and group a note (split & title 2)
property delim : “” – enter your delimiter between the quotes
tell application id “com.devon-technologies.thinkpro2”
set theDatabase to current database
set theGroup to current group
set theseItems to the selection
if selection is {} then error “Please select some contents”
repeat with thisItem in theseItems
set selectionURL to ((“x-devonthink-item://” & uuid of thisItem) as string)
set targetGroupName to “/Exploded:” & (name of thisItem as string)
set targetGroup to create location targetGroupName in theDatabase
set targetGroupURL to (“x-devonthink-item://” & uuid of targetGroup)
set URL of thisItem to targetGroupURL
set theText to text of think window 1
set {TIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, delim}
set listSections to text items of theText
set AppleScript's text item delimiters to TIDs
repeat with cSection in the listSections
if length of cSection ≠ 0 then
set textTitle to paragraph 1 of cSection
set textContent to paragraphs 2 thru end of cSection
create record with {name:textTitle, content:textContent, URL:selectionURL, type:rtf} in targetGroup
end if
end repeat
end repeat
end tell