Automatically Post Safari Tabs to Del.icio.us With “topost” Tag
Tuesday, March 25th, 2008
I wrote a short AppleScript yesterday to allow you to automatically add the current tab in Safari to your bookmarks in Del.icio.us with a specified tag or tags. The default tag is “toPost.” Add the script into Quicksilver as a trigger and you’ve got an über convenient post later (or never) script.
Here is the script (or download it here):
-- To change the tags, edit text inside quotes below
-- Use spaces to seperate multiple tags (ex: "tagOne tagTwo")
set tags to "toPost"
-- build delicious URL for current tab in frontmost window of Safari
tell application "Safari"
set u to (name of current tab of front window) & ¬
"&url=" & (URL of current tab of front window) & ¬
"&tags=" & tags
end tell
-- Add URL to Delicious
tell application "Safari"
do JavaScript "javascript:void(open('https://api.del.icio.us/v1/posts/add?description=" & u & "','delicious','toolbar=no,width=150,height=100'));" in document 1
delay 0.5
close current tab of front window
end tell
This is basically a simple modification of the script written by Andrew Faden which does pretty much the same except from NetNewsWire instead of Safari. Be sure to check out his original script and also the much improved version submitted by Larry from http://scriptingforlawyers.com/.