I found this Applescript for posting Journler entries to Blogger. "Written by Eric Knibbe, 2008 (http://knibbe.fmly.ca/) with code from http://schinckel.net/2006/03/05/searching-zen/ and http://code.mostrom.pp.se/applescript/journler2marsedit.html"
It had some features for Markdown and SmartyPants that I don't use, so I cut them out. I just wanted to put several Journler entries into Blogger all in one go. This script does that perfectly. It even tags the Journler entries as Blogged. Cool.
Like my NNW script, Journler2Blogger uses the BlogThis! Bookmarklet. But Eric cleverly avoids the 250 character limit by copying the Journler entry text to clipboard. I had to paste each Journler entry into the BlogThis! window. But that was no problem because the script waits for confirmation before posting the next Journler entry.
I am using the BlogPlus extension in Flock for most of my posting but it was fun to learn some new ways to use BlogThis! and Applescripts. Someday I'll probably want to use MarsEdit for all of this. Would be faster and simpler, for sure. :-)
-- Here is Eric's wonderful Applescript (as mangled by myself). Worked for getting multiple Journler entries into Blogger. YMMV. --
property tagBlogged : "Blogged"
tell application "Journler"
set blogEntries to selected entries
if blogEntries = {} then
display dialog "There are no entries selected." buttons "Cancel" default button "Cancel" with icon 0
else
repeat with anEntry in blogEntries
set entryText to rich text of anEntry
set entryText to do shell script "echo " & quoted form of entryText
if the button returned of (display dialog name of anEntry & return & entryText buttons {"Cancel", "Copy & Post"} default button 2) is "Copy & Post" then
set the clipboard to entryText
set date created of anEntry to (current date)
set isTagged to false
set anEntryTags to tags of anEntry
repeat with tag in anEntryTags
if tag as string is equal to tagBlogged then
set isTagged to true
end if
end repeat
if isTagged is false then
set tags of anEntry to (tags of anEntry) & tagBlogged
end if
set entryName to my encode_URL_string(name of anEntry)
tell application "System Events"
open location "http://www.blogger.com/blog_this.pyra?&n=" & entryName
end tell
end if
save changes
end repeat
end if
end tell
property allowed_URL_chars : (characters of "$-_.+!*(),1234567890abcdefghijklmnopqrstuvwxyz")
property hex_list : (characters of "0123456789ABCDEF")
on encode_URL_string(this_item)
set character_list to (characters of this_item)
repeat with i from 1 to number of items in character_list
set this_char to item i of character_list
if this_char is not in allowed_URL_chars then set item i of character_list to my encode_URL_char(this_char)
end repeat
return character_list as string
end encode_URL_string
on encode_URL_char(this_char)
set ASCII_num to (ASCII number this_char)
set x to item ((ASCII_num div 16) + 1) of hex_list
set y to item ((ASCII_num mod 16) + 1) of hex_list
return ("%" & x & y) as string
end encode_URL_char
1 comment:
Someone found my script useful! Awesome.
Post a Comment