Integration with Voodoopad

Under Get Name:

tell application "VoodooPad"
	tell front document
		set theResult to current page name
	end tell
	return theResult
end tell

Under Get Address

tell application "VoodooPad"
	tell front document
		set theResult to current page name
		tell page theResult
			set theUUID to uuid
		end tell
	end tell
	set theLink to "x-voodoopad-item://" & theUUID
	return theLink
end tell

Thanks for your contribution, Marlowe. We’ll check it out. Spotlight remind me I tried Voodoopad in 2011…

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

Thanks, much @marlowe! We’ve published adaptations of this in v. 98 of Hook’s integration scripts.

As noted:

regarding the first bullet, I’ve now updated Creating Integration Scripts – Hook to make it clear that and when “get name” is optional.

Regarding the second bullet: The default “Link to New” is simpler than the script published in post 3. By using the default “Link to New” behavior, the script does not depend on particular location of notes. However, advanced users may prefer to use and potentially adapt @marlowe 's “Link to New” script.

A case could be made for a “Link to New” script that would check to see if there is a Voodoopad document open and then create one, otherwise to fall back on Hook’s default “Link to New” behavior (making a copy of the template in Hook’s Notes folder). This conditional branching might require some changes to the script framework so that the script can tell Hook to fall back on its default, which might be handy.

Also, I assume that some variants of the previously proposed script could be suggested. So we could revisit the built in later.