Integration with Voodoopad

I tried to make a New Document script as well. It’s set up for the file ~/Dropbox/wiki.vpdoc. Seems to be working.

tell application "VoodooPad"
	set documentName to "Wiki.vpdoc"
	set the clipboard to "$title"
	activate
	set openDocs to name of documents
	if openDocs contains "Untitled" then close document "Untitled"
	if openDocs contains documentName then
		activate
	else
		tell application "VoodooPad"
			open "~/Dropbox/Wiki.vpdoc"
			delay 0.5
		end tell
	end if
	delay 0.2
	tell front document
		create new page with name "$title" with content "This is a new page."
		delay 0.2
		
		set theResult to current page name
		tell page theResult
			set theUUID to uuid
		end tell
	end tell
	
end tell
set theLink to "x-voodoopad-item://" & theUUID
return theLink