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/.

Multi Safari

Apple has just released the 10.4.11 update for Mac OS X Tiger, which has two inter­est­ing tid­bits. First of all, it lists “Improves com­pat­i­bil­ity when using Open­Type fonts in QuarkExpress.” I would be really inter­ested in know­ing more about exactly what has changed here. Unfor­tu­nately, given how tight-​lipped Apple usu­ally is about these types of things, I doubt I’ll find out.

The second item per­tains to Safari 3. Start­ing with this update, Safari 3 will be the default browser. Now, this is really great, but it intro­duces some prob­lems with my work­flow. If I install this update, how am I going to be able to con­tinue to test my designs in Safari 2.x?

As it turns out, Michel Fortin has gone through the trou­ble of cre­at­ing stand­alone ver­sions of every Safari install­ment. So go ahead, jump on that update from Apple, then grab a stand­alone copy of Safari 2.

Firefox 3 To Ditch Unified Cross Platform Look

Mozilla’s Alex Faaborg announced a week or so ago that Fire­fox 3 would focus on visu­ally inte­grat­ing with the oper­at­ing system:

Visual inte­gra­tion with Win­dows and OS X is our pri­mary objec­tive for the Fire­fox 3 refresh.

This is great news for Fire­fox, because as I have men­tioned before, its user inter­face has really been the achilles’ heel of the browser, espe­cially on the Mac.

Mozilla’s user expe­ri­ence team lit­er­ally wants to do a better job of visu­ally inte­grat­ing with Win­dows than IE, and a better job of visu­ally inte­grat­ing with OS X than Safari. I don’t know if we will be able to pull that off, but that’s the goal.

I’m glad that they’ve rec­og­nized this as an issue and I can’t wait to see what they come up with. If Fire­fox actu­ally did look as good or better than Safari on a Mac, I might use it as my pri­mary browser.

Via Beauty And The Geek: Fire­fox 3’s Visual Makeover.

An Even Better “Open in Firefox”

Yes­ter­day I blogged about the nifty little Open in Fire­fox script that I made. As it turns out, there is an even better way to this, using some fancy Quick­sil­ver magic.

By using Proxy Objects in Quick­sil­ver, you can gain access to the Current Web Page object. After making sure that you have acti­vated the Open URL With... action in the Quick­sil­ver pref­er­ences you are free to spec­ify Fire­fox (or another browser).

Current Web Page → Open URL With... → Firefox

Once you have this work­ing, you can set it up as a custom trig­ger. I set mine to the F1 key. Even better, this trig­ger is much more extend­able than the script. You might not nec­es­sar­ily always want to open a URL in Fire­fox. Say you want to open a page in Opera. Just create another trig­ger, but leave out the item in the third pane.

Current Web Page → Open URL With... → "Leave this blank"

Now when you use that trig­ger, acti­vate it with a hotkey (I used F2) and type in the first few let­ters of the browser (or pro­gram) you want the URL to open in.

Open in Firefox

I cur­rently use Safari as my pri­mary browser on OS X sys­tems. Often­times I find that I either want to dis­sect a web page in Fire­bug or even just see what it looks like in Fire­fox. This is kind of a pain because it takes sev­eral steps:

  1. Open Fire­fox (one step with Quick­sil­ver)
  2. Acti­vate Safari
  3. Copy URL from desired website
  4. Acti­vate Firefox
  5. Paste URL into Firefox.

I could prob­a­bly con­sol­i­date these steps a little bit (by drag­ging and drop­ping the URL per­haps), but the point remains, this is an annoy­ing process to go through every time I want to quickly check some­thing out in Firefox.

Last week I put together a nifty little script in Automa­tor to stream­line this process. Basi­cally, the script copies the URL from the active tab in Safari, opens Fire­fox and loads the page. I saved the script as an appli­ca­tion and with Quick­sil­ver it’s now just one step to acti­vate the script.

For the most part, the script was pretty easy to set up. There is a built-​in action to Get Current Webpage from Safari. There aren’t any script­able actions for Fire­fox from Automa­tor, but open­ing it is simple enough using a ter­mi­nal command:

open -a Firefox.app

The only slightly tricky part about the script was get­ting the copied URL to auto­mat­i­cally load when Fire­fox opens. After a little research I found that this could be simply passed as a para­me­ter to the open command:

open -a Firefox.app $@

Per­haps some other Safari-​lovers will find this useful. Enjoy.