Sunday, June 8, 2008

Publish NNW tabs in Blogger

Use this Applescript to publish the current tab from NetNewsWire into your Blogger Blog. It uses the same syntax as the BlogThis! bookmarklet.

Important: This only works from the tabs panel. If you try to publish from the News Items list, the app will just quit without an error message. I made it this way 'cause I only read articles in the NNW tabs panel.

Also you can only copy about 250 characters into the BlogThis! bookmarklet or Google will give you an error message about bad syntax or something. 250 characters is about 2 paragraphs. If you need more text, then you have to switch back to NNW and copy-paste into your BlogThis! window.


To use the script:
1. Past the code into Script Editor.
2. Save as a run-only application in your apps folder. (I called mine NNW2Blogger.)
2. Set NNW prefernences to Post to Weblog Using... NNW2Blogger

To post a NNW article:
1. Copy some text from the article. (Really, you need to copy some text to the clipboard. About 2 paragraphs or less.)
2. Click Post to Weblog.
3. Edit your new post.


-- Here's the code to roll your own applescript. Just remember to save it as a run-only application. I saw parts of this script somewhere but can't remember who to credit. --

try
tell application "NetNewsWire"

set tab_num to ((index of selected tab) + 1)
set url_ to (item tab_num of (get URLs of tabs))
set title_ to (item tab_num of (get titles of tabs))

set entrytitle to "&n=" & title_
set entryUrl to "&u=" & url_

if title_ is "News Items" then
error number -128
end if

tell application "System Events"
open location "http://www.blogger.com/blog_this.pyra?&t=" & (the clipboard) & entryUrl & entrytitle
end tell
end tell
end try

No comments: