Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Until Snow Leopard URL files (.webloc files that you get when you drag a URL onto the desktop) opened with OmniWeb on my computer and some URLs were configured to open with Safari.

After upgrading to Snow Leopard all URL files open with "Finder" which then proceeds to open the standard browser (OmniWeb) for them. I tried changing the association, but Snow Leopard insists that these files be opened with OmniWeb via Finder.

Any ideas what I can do to fix this? I want all webloc files to open in OmniWeb except for specific ones which should open in Safari. I had it configured that way but at some point Mac OS X decided that the Safari ones should open with Finder (which then opens them with OmniWeb) and it just ignores it when I try to change that configuration per file

share|improve this question
1  
Are you talking about .webloc files or .htm files or .html files or .webarchive files? "URL files" doesn't really make it clear what you're talking about. –  TJ Luoma Dec 13 '11 at 22:50
    
From his comment on Jack's answer: it's .webloc. –  MattiSG Jan 13 '12 at 7:29
    
I thought a .webloc file was a URL file. –  Andrew J. Brehm Jan 13 '12 at 8:40

4 Answers 4

As far as I know, there is no way to associate .webloc files with a specific application. Your best bet would probably be to use some AppleScript.
I made a little script that lets you generate tiny little AppleScript applications that open in the browser that you select upon creation (OmniWeb, Safari, or Chrome).

You can download the script here, or compile it yourself from the code below.

set theURL to text returned of (display dialog "What URL would you like to bookmark?" with title "Enter URL" default answer "http://")
set theApp to (choose from list {"OmniWeb", "Safari", "Chrome"} with prompt "Which application would you like to associate with the bookmark?" with title "Select Application") as string
set theName to text returned of (display dialog "What would you like to name the bookmark?" with title "Enter Name" default answer "")
set theFolder to choose folder with prompt "Where would you like to save the bookmark?"

if theApp is "OmniWeb" then
    set theScript to "tell application \"OmniWeb\"
    activate
    try
        set theTab to make new tab at end of front browser with properties {address:\"" & theURL & "\"}
        set active tab of front browser to theTab
    on error
        make new browser with properties {address:\"" & theURL & "\"}
    end try
end tell"
else if theApp is "Safari" then
    set theScript to "tell application \"Safari\"
    activate
    try
        set theTab to make new tab at end of tabs of front window
        set the URL of theTab to \"" & theURL & "\"
    on error
        make new document
        set theTab to tab 1 of front window
        set the URL of theTab to \"" & theURL & "\"
    end try
    set current tab of front window to theTab
end tell"
else if theApp is "Chrome" then
    set theScript to "tell application \"Google Chrome\"
    activate
    if (count of windows) = 0 then
        make new window
        set URL of tab 0 of front window to \"" & theURL & "\"
    else
        set URL of (make new tab at end of tabs of front window) to \"" & theURL & "\"
    end if
end tell"
end if

tell application "AppleScript Editor"
    set theDoc to make new document with data theScript
    save theDoc as "application" in ((theFolder as string) & theName & ".app")
end tell

Running that will prompt you for the URL, the browser you want it to open with, and the location to save the 'bookmark'.

You can put this in your Applications or Scripts folder for easy access and invoke it whenever you want to save a URL.

share|improve this answer

You need to make an Automator Script with these elements: (and save as an App)

  • RunShellScript -> open -a Firefox.app
  • Pause (2 Seconds)
  • RunShellScript -> open -a Firefox.app http://www.apple.com
share|improve this answer
1  
Why the two calls to open -a? The second one should be enough. –  patrix Nov 10 '12 at 19:30

You may want to read this article at Macworld: http://www.macworld.com/article/142937/2009/09/snowfiles.html

But the meat of the fix from the Workaround section is:

Control-click on the file in question, then hold down the Option key, then select Always Open With, and choose the desired application from the (potentially huge) list of alternatives. You’ll have to do this every time you create a new file; there’s no way to set the creating application as the default opening application.

I'm, unfortunately, on Windows at work, so I can't confirm this fix. But it sounds like it's the way to go.

share|improve this answer
    
That only affects individual files, and doesn't appear to work any different from reassociating all .webloc files. –  ؘؘؘؘ Dec 13 '11 at 17:04
    
Also, in my case the problem is that Webloc files are suddenly associated with the Finder which then opens them with OmniWeb (my default browser). –  Andrew J. Brehm Dec 14 '11 at 9:31
1  
Do you want all webloc files associated with OmniWeb, or just specific ones (and others open in Safari, or whatever your default browser is)? –  Jack Brewster Dec 14 '11 at 16:57
    
I want all webloc files to open in OmniWeb except for specific ones which should open in Safari. I had it configured that way but at some point Mac OS X decided that the Safari ones should open with Finder (which then opens them with OmniWeb) and it just ignores it when I try to change that configuration per file. –  Andrew J. Brehm Jan 13 '12 at 8:39
    
I just tried the Get Info trick on Lion Server and no matter what I do, the .webloc files always open with Safari. I tried reversing it, by making Chrome default and setting Safari on individual .webloc, but they always opened with Chrome. Other than using "Open With", there doesn't appear to be a way to do what you want. Sorry. –  Jack Brewster Jan 13 '12 at 21:53

The solution you're looking for is not a simple one. One idea that came up to mind I have posted in: bind application to file of particular names(rather than suffix). I am not a professional Apple developer, nor am I familiar with the intricate details of the OS. But as a casual programmer, I think that would be possible solution.

The above if you want to keep on using .webloc of course. What I would do though is the following:

  1. Change the extension of those particular bookmark files that you want to open with a particular application to .url.
  2. Associate those with the desired browser.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.