Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: mswinurl - Those URL files from *******r

  1. #1
    Join Date
    Dec 2006
    Beans
    Hidden!

    mswinurl - Those URL files from *******r

    I have a huge number of .URL files on my drive since I have never used bookmarking... its so much more efficient to drop links into folders, and far more flexible.

    Unfortunately, GNOME uses a different format and won't accept the ******* URL file under any circumstances. The only option is to open the URL file in a text editor and grab the url with copy --> paste.

    So here's how to open that URL file automatically:

    First create this script and name it url.sh:
    Code:
    #!/bin/bash
    
    IFS=$'©'
    
    FFOPENURL=$(grep -a -G URL=* $1)
    
    firefox ${FFOPENURL#*=}
    That will find the URL in the .URL file, and open firefox with it. To test it, try this in a terminal:
    Code:
    bash <dir>/url.sh <path to URL file>
    Now enter these commands:
    Code:
    sudo cp <path to url.sh> /usr/bin
    sudo sudo chmod ugoa+x /usr/bin/url.sh
    Or anywhere else you want it to go. I prefer /usr/bin because its easy to remember. (PATH won't help us here however since this isn't exactly a command)

    Finally its time to associate the [Internet Shortcut] or .URL file format in GNOME/Nautilus.
    Right click on a .URL file and go to the "open with" tab. Associate it with this command:
    Code:
    bash /usr/bin/url.sh
    If all goes well, you can now open the url file in FireFox.

    If all doesn't go well (it didn't for me) you will get an error about insecure filetype... bla bla bla. If that happens, associate the file with a text editor and right click the file to get "open with bash".
    Note: this quirk is not present in KDE!

    Edit: Here are some keywords that might make this tutorial more searchable.
    Microsoft Windows url file .url shell script interoperability internet shortcut how to plain text mswinurl bookmark microsoft windows
    Last edited by psych787; July 19th, 2007 at 03:30 AM.

  2. #2
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: mswinurl - Those URL files from *******r

    Has anyone else actually used this?
    Last edited by psych787; July 19th, 2007 at 03:30 AM.

  3. #3
    Join Date
    May 2007
    Location
    Rochester, Kent, England.
    Beans
    47
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: mswinurl - Those URL files from *******r

    Yeah, I've got it working beautifully in Kubuntu.
    Try this one:
    http://ubuntuforums.org/showthread.php?t=495131

    Note: as one of the lower posts said, the code should be changed from
    Code:
    chop($in);
    to
    Code:
    chomp($in);

  4. #4
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: mswinurl - Those URL files from *******r

    I saw that one... that was the thread that made me think no one was using this little script. (I posted there)

    Thanks for the reply, glad to know it was useful .

  5. #5
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: mswinurl - Those URL files from *******r

    I've modified the script to open whatever browser you have configured as default in KDE:

    Code:
    #!/bin/bash
    IFS=$'©'
    FFOPENURL=$(grep -a -G URL=* $1 | tr '\r' '\n')
    kfmclient openURL ${FFOPENURL#*=}
    I also added a call to 'tr' to clean out windows-style line ends (character 0D)

    I think in Gnome you have to use gnome-open instead of kfmclient, but I don't run Gnome.

  6. #6
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: mswinurl - Those URL files from *******r

    Great idea! I've been hunting for the tool to use KDE associations from the command line for weeks! Thanks!

  7. #7
    Join Date
    May 2008
    Location
    Edinburgh, UK
    Beans
    188
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mswinurl - Those URL files from *******r

    This is great. Thanks for working this out.

  8. #8
    Join Date
    Apr 2008
    Location
    Ohio
    Beans
    202

    Re: mswinurl - Those URL files from *******r

    What would you do to open it in the current Firefox window in a new tab?

  9. #9
    Join Date
    Sep 2008
    Beans
    1

    Re: mswinurl - Those URL files from *******r

    psych787, thanks for this post. I followed your steps, and it worked perfectly the first time. Your help is much appreciated!

  10. #10
    Join Date
    Jul 2008
    Beans
    4

    Re: mswinurl - Those URL files from *******r

    Thanks for this. Some of my ******* shortcuts also had this in them, e.g.:

    [DEFAULT]
    BASEURL=http://www.....

    My solution was to add a 'newline' to the grep regular expression:

    Code:
    #!/bin/bash
    IFS=$'©'
    FFOPENURL=$(grep -a -G ^URL=* $1 | tr '\r' '\n')
    firefox  ${FFOPENURL#*=}
    Note that I also deleted 'openURL' since it just seemed to open www.openurl.com !!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •