4

I spend my day at work on Windows XP and at home on OS X. I use Firefox on both. I have certain folders sync'ed where I like to drag and drop links to look at later. On XP the link files are saved as .url and on OS X they're saved as .webloc and Firefox on either OS can't use the format used by the other (.url files do at least open in Safari on OS X).

I'd like to keep using files and not have to save links in emails or on sites like delicious. I'd also like to keep using Firefox in both environments. Is there a way to make Firefox on either OS accommodate the files from the other? Maybe an extension or plugin? I'm not picky about which format works. Ideally I'd like to keep both because I like choice but either is fine.

Dinah
  • 281

3 Answers3

4

Instead of dropping the link files into a folder, why not make another folder in your bookmarks for these links to look at later? Then you can display the folder on the bookmarks toolbar and easily drop links into it. Then you can use XMarks to manage your bookmarks cross-platform and cross-browser.

alt text

Gareth
  • 19,080
2

If you double-click a .url file in Snow Leopard, it will open in Safari. To get it to open in Firefox:

  1. Open the Applescript editor
  2. Paste in the Applescript below (courtesy of this Stack Overflow post)
  3. Save it as an application
  4. In the finder, select a .url file
  5. Choose Get Info from the File menu
  6. Specify this new application under Open With
  7. Click on Change All, and confirm the action

To open a .webloc file in Firefox in XP, I made a C# application:

  1. Open Visual Studio. Express versions are free from Microsoft.
  2. File menu -> New -> Project
  3. Select Console Application. Name it. Ok
  4. In the Solution Explorer, right-click on the project name -> Properties
  5. Output type: Windows Application. This is so when Windows opens your console app, no console window is displayed
  6. Paste the below C# program into Program.cs
  7. Build menu -> Build Solution
  8. Double click on a .webloc file. When it asks what program to use, select from list then browse to the new exe you just made

Applescript:

on open the_droppings

    set filePath to the_droppings

    set fileContents to read filePath

    set secondLine to paragraph 2 of fileContents

    set tid to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "="
    set URLstring to last text item of secondLine
    set AppleScript's text item delimiters to tid

    do shell script "/usr/bin/open -a Firefox.app " & quoted form of URLstring
end open

C# app:

using System;
using System.IO;
using System.Diagnostics;
using System.Xml;

class Program {
    static void Main(string[] args) {
        if (args == null || args.Length == 0 || Path.GetExtension(args[0]).ToLower() != ".webloc")
            return;

        string url = "";

        XmlTextReader reader = new XmlTextReader(args[0]);
        while (reader.Read()) {
            if (reader.NodeType == XmlNodeType.Element && reader.Name == "string") {
                reader.Read();
                url = reader.Value;
                break;
            }
        }

        // I specify Firefox because I have weird demands for my work computer.
        // To have it open in your default browser, change that line to this:
        // Process.Start(url);
        if (!String.IsNullOrEmpty(url))
            Process.Start("Firefox", url);
    }
}
Dinah
  • 281
0

I'd like to expand on jtimberman's answer in favor of delicious (+1 there).

  1. You can save private bookmarks on delicious
    • You can share these bookmarks (with limited groups even when they are private)
    • Bookmarks can be exported (to your backup) and imported
      (maybe, even after some edits in the backup -- which is an XML file).
      Look at my answer at the first point for more notes.
    • You can also keep the bookmarks synced with your firefox browsers across platforms.
      Which means, they appear like local bookmarks on each browser instance (and are sync'ed in the background). Read up more at the FAQ.
nik
  • 57,042