split document

I use Skim pdf reader for notes in pdf documents. In exported file ( .rtf, skim notes…) are all notes bundled together. Is there some way in Devonthink to make separate document from every single note? I know about “split document” function, but from file with 100+ notes it is really time consuming process. Thank you. Ben

Have you considered Christian’s script in this thread - Can someone create a “split and title” script?

Works beautifully. Thanks. The only problem is that notes are in this format:

• Highlight, page 40
One thing that comes out in myths…

• Highlight, page 41
That’s utterly fascinating, because they are…

and script keeps making from “• Highlight, page 41” separate file. Its not a big deal, but it would be nice to have it together with rest of the note.

Thank you.

I made this one based on a kalisphoenix script. This is intended to work with documents made using the Skim Notes extractor script here: http://www.devon-technologies.com/scripts/userforum/viewtopic.php?f=20&t=10849&p=52635&hilit=skim#p52635.

Run your Skim’ed PDFs through the script above, then run the new file(s) through the script below. It should make separate files for each annotation. The type of note and the page reference is below the actual annotation. Each of the files is linked back to the original PDF at the page of the annotation.


tell application id "com.devon-technologies.thinkpro2"
	set theSelection to the selection
	if theSelection is {} then error "Please select some contents."
	set SplitPointRegEx to "* "
	set OldDelimiters to AppleScript's text item delimiters
	repeat with CurrentItem in theSelection
		set AppleScript's text item delimiters to SplitPointRegEx
		set TheUID to URL of CurrentItem
		set theSource to the plain text of CurrentItem
		set theReference to name of CurrentItem
		set RepeatCount to 0 as integer
		set TotalCount to (count each text item of theSource) as integer
		repeat until RepeatCount is equal to TotalCount
			set RepeatCount to RepeatCount + 1
			set CurrentText to (text item RepeatCount of theSource)
			if length of CurrentText is greater than 0 then
				create record with {name:paragraph 2 of CurrentText, type:rtf, content:"\"" & paragraph 2 of CurrentText & "\"" & (ASCII character 10) & (ASCII character 10) & theReference & (ASCII character 10) & paragraph 1 of CurrentText, URL:TheUID & "?page=" & ((last word in paragraph 1 of CurrentText) - 1)}
			end if
		end repeat
	end repeat
	set AppleScript's text item delimiters to OldDelimiters
end tell


Great job!!!
Thx