Posting articles with Tweetie from within NetNewswire

When i first bought a Mac, about 4 years ago, I loved NetNewsWire. Then, when Twitter grew bigger, but was still about information sharing I moved to Twitteriffic and RSS sort of became less important to me. But as Twitter lost in information sharing activity - at least with respect to the info i'm interested in - and gained in chit-chat, i moved back to RSS, using Google Reader.

Honestly, i believe that Google Reader is a great product, but the imposed work-flow is not quite what suits me. And being an Mac user, the aesthatics felt … uncomfortable. Bottom line, after trying just about all other RSS readers for the Mac, I moved back to NetNewsWire. Also, i have since moved to Tweetie rather than Twitteriffic as it just feels more intuitive to me. But … NetNewsWire doesn't allow me to post using Tweetie. As a result i found myself copy and pasting a lot in order to share interesting articles via Twitter.

After searching for a solution, and complaining via Twitter, I found this website which listed a lot of AppleScripts that can be used from within NetNewsWire. Being the nerd that I am i decided to attempt to create one that would let me post directly through Tweetie. While i was at it, i decided to do url shortening in the script as well, to reduce the required number of clicks inside the tweetie compose window. Anyway, here's what i came up with:

tell application "NetNewsWire"
	if index of selected tab = 0 then
		set s to URL of selectedHeadline
		set t to title of selectedHeadline
	else
		set i to index of selected tab
		set i to i + 1
		set URL_list to URLs of tabs
		set s to item i of URL_list
		set Title_list to titles of tabs
		set t to item i of Title_list
	end if
	
	set s to "http://is.gd/api.php?longurl=" & s
	set shortUrl to (do shell script "curl --url \"" & s & "\"")
end tell

tell application "System Events"
	open location "tweetie:" & t & " (" & shortUrl & ")"
end tell

To install, just download the file and save it in the following folder: ~/Library/Application Support/NetNewsWire/Scripts (where ~/ is the root of your user folder)

Just for the record, i can not claim to have came up with all code myself, as i am in no way an AppleScript expert. Perhaps the code could be improved upon, if so, let me know! For now, enjoy the script and use it at your own risk.

Better Post with Tweetie.scpt (4.60 kb)

Comments

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7