[MlMt] Safari to Pinboard?

Nitin Goyal go4nitin at gmail.com
Mon Aug 26 14:12:16 EDT 2013


How is this applescript?

	tell application "Safari"
		set theURL to (URL of current tab of window 1)
		set theTitle to (name of current tab of window 1)
	end tell

	on url_encode(theText)
		return do shell script "printf " & quoted form of theText & " | xxd -u 
-plain | sed 's/\\(..\\)/%\\1/g' | tr -d '\\n'"
	end url_encode
	set theReceiver to "Some One <tosomeone at example.com>"
	set theSender to “Your Name <youremail at example.com>"
	on create_mailto(theTitle, theURL, theReceiver, theSender)
	
		set _mailto to "mailto:?to=" & url_encode(theReceiver) & "&from=" & 
url_encode(theSender) & "&subject=" & url_encode(theTitle) & "&body=" & 
url_encode(theURL) & "&send-now=yes"
		return _mailto
	
	end create_mailto

	set _mailto to create_mailto(theTitle, theURL, theReceiver, theSender)
	tell application "MailMate"
		open location _mailto with trust
	end tell

Even this simple looking script was quite a task for me :)


More information about the mailmate mailing list