Batch Capturing of Facebook bookmarks

I am using Devonthink Pro Office 2.9.12 on OSX 10.11

I have thousands of saved facebook bookmarks and I want to download and convert the bookmarks into offline web archives (to search and analyze offline).

Now, one way of doing this is to use the “Convert to Web Archive” script. The problem is that the script downloads only public Facebook posts. It doesn’t read private Facebook posts as if it doesn’t recognize my Facebook credentials/login.

On the other hand, when I CAPTURE (not convert) each bookmark separately, Devonthink download the private facebook post successfully.

Can DEVONthink batch convert the private Facebook posts and how can I feed in my credentials?
where can I find a script that can batch capture my bookmarks ?


The following script uses credentials entered in DEVONthink:

tell application id "DNtp"
		set theSelection to the selection
		if theSelection is not {} then
			show progress indicator "Converting..." steps (count of theSelection)
			set theWindow to missing value
			repeat with theRecord in theSelection
				set theName to (name of theRecord) as string
				step progress indicator theName
				if cancelled progress then exit repeat
				if type of theRecord is bookmark then
					if theWindow is missing value then
						set theWindow to think window of (open tab for record theRecord)
						set record of theWindow to theRecord
					end if
					repeat while loading of theWindow
						delay 0.5
					end repeat
					set theData to web archive of theWindow
						set theParents to parents of theRecord
						set theWebArchive to create record with {name:theName, URL:(URL of theRecord) as string, type:webarchive} in (item 1 of theParents)
						repeat with i from 2 to (count of theParents)
							replicate record theWebArchive to (item i of theParents)
						end repeat
						set data of theWebArchive to theData
						set creation date of theWebArchive to creation date of theRecord
						set modification date of theWebArchive to modification date of theRecord
						set comment of theWebArchive to comment of theRecord
						set label of theWebArchive to label of theRecord
					end try
				end if
			end repeat
			if theWindow is not missing value then close theWindow saving no
			hide progress indicator
		end if
	on error error_message number error_number
		hide progress indicator
		if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
	end try
end tell