Safari on OS X: how-to add a “Tweet this” shortcut to the bookmarks bar

Safari LogoI already once posted this in my Blog some time ago, but recently found out, that the previously used solution with doesn’t work anymore and even got a bit “suspicious”. In the meantime, Twitter is offering it’s own “Tweet this” popup window. I made use of this feature now for a shortcut button in the Safari bookmarks bar.

Thanks to the built in shortcut feature in Safari, you may use Command+[Number] to directly fire this new bookmark from within the bookmarks bar. In my example it would be Command+5 (the “-> Tweet this” button is at the 5th location in the bookmarks bar).

So here is the screencast with the How-to:

And this is the JavaScript code you will need to copy-paste as new bookmark in Safari:"" + encodeURIComponent(location.href) + "&text=" + ((document.title) ? encodeURIComponent(document.title.replace(/^\s*|\s*$/g,"")):"") + "&tw_p=tweetbutton&url=" + encodeURIComponent(location.href), "Post to Twitter", "width=500, height=600, location, status, scrollbars, resizable");

By the way: this solution should also work on other web browsers such as Firefox or Chrome! Haven’t tested it though.

Leave a Reply

Your email address will not be published. Required fields are marked *