Login

Vienna Plugin for Tweetie

Vienna 2.5 beta has a new plugin feature. You can read the plugin documentation here. It uses a plist file to configure the plugin so it is fairly simple to implement.

Vienna 2.5 comes with a Twitter plugin already installed as an example. This example uses the link plugin style which launches a webview where you access your Twitter account. This is a great example and will work for many. For my purposes, I prefer to use the excellent Tweetie application. Tweetie has a build-in url-scheme that you can use as a bookmark in your web browser or, as I am about to show, from an AppleScript.
Vienna is also scriptable, so I wrote an AppleScript to get the title and link of the selected article and then use Tweetie's url-scheme to open a new tweet window.
AppleScript Code
tell application "Vienna"
	if exists current article then
		set selectedArticle to the current article
		tell selectedArticle
			set thisLink to link
			set thisTitle to title
		end tell
	end if
end tell

set tweetText to thisTitle & space & thisLink
tell application "System Events"
	open location "tweetie:" & tweetText
end tell
Here Is The Plist File I added the MenuKey key to use cmd+shift+alt+T as a shortcut.
I also copied the icon from Tweetie and reduced its size to 16x16 and included it in the plugin folder. This is the icon that is displayed in the Vienna toolbar.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<dict>
	<key>Name</key>
	<string>ShareWithTweetie</string>
	<key>Type</key>
	<string>Script</string>
	<key>Script</key>
	<string>tweetie.scpt</string>
	<key>Default</key>
	<true/>
	<key>FriendlyName</key>
	<string>Tweetie</string>
	<key>Tooltip</key>
	<string>Share the current article on twitter using Tweetie</string>
	<key>ButtonImage</key>
	<string>tweetieButton</string>
	<key>ShortenURLs</key>
	<true/>
	<key>MenuPath</key>
	<string>Share With Tweetie</string>
	<key>MenuKey</key>
	<string>Cmd+Shift+Alt+T</string>
</dict>
</plist>
Putting It All Together The plugins folder is located inside the Vienna bundle. I am sure the developers have a reason for this but it seems like the Application Support folder would have been a better choice.

Right-click on the Vienna application and choose Show Package Contents. Navigate to (Contents->SharedSupport->Plugins). Stock with the application are three plugins; ShareWithEvernote, ShareWithFacebook and ShareWithTwitter.

Create a folder inside the Plugins folder and name it ShareWithTweetie. Add the info.plist, tweetie.scpt and tweetieButton.tiff to this folder. Restart Vienna and you will see the Tweetie icon in the toolbar. Select an article, click the ShareWithTweetie button and post away!

If you would like to simply add this functionality to Vienna, download ShareWithTweetie (6.51 kB) and add it to the plugins folder as described above.

As always, if you have any questions or comments... post them below.

Add comment


Security code
Refresh

 

Product Categories