Automatically Post Safari Tabs to Del.​icio.us With “topost” Tag

I wrote a short Apple­Script yes­ter­day to allow you to auto­mat­i­cally add the cur­rent tab in Safari to your book­marks in Del.​icio.us with a spec­i­fied tag or tags. The default tag is “toPost.” Add the script into Quick­sil­ver as a trig­ger and you’ve got an über con­ve­nient post later (or never) script.

Here is the script (or down­load 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 basi­cally a simple mod­i­fi­ca­tion of the script writ­ten by Andrew Faden which does pretty much the same except from Net­NewsWire instead of Safari. Be sure to check out his orig­i­nal script and also the much improved ver­sion sub­mit­ted by Larry from http://​script​ing​for​lawyers.com/.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply