Creating Windows shortcuts from Chrome bookmarks

1,711

Solution 1

After searching the web for a while, I came to the conclusion that there is no simple solution for this problem. There are different methods to save a link or a bookmark as a Windows URL shortcut, but there is no way to do it for multiple links / URLs at once.

Daniel Beck suggested an OS X / Safari bookmarks file based script, but I didn't manage to execute the script because I wasn't sure how to adapt it to Windows, even with Cygwin.

I realized the only way to achieve my goal is by using a script, so I posted a programming-specific question on Stack Overflow and asked for a script which would take the URLs from the links inside the bookmarks.html file and use them to create Windows URL shortcuts.

Here is the question + the answer (it's a VBScript):

Creating multiple Windows URL shortcuts from a bookmarks HTML file.

Solution 2

Here is what I did:

  1. I exported CHROME BOOKMARKS (also did this to my GOOGLE BOOKMARKS) as a single .html file. This can be done in Chrome through the bookmark manager's ORGANIZE | EXPORT dropdown.

  2. I then opened my USER\Favorites folder. I don't use IE so it had all the default links IE comes with. I created a new folder called CHROME BOOKMARKS.

  3. I opened IE and clicked the star shaped FAVORITES button. I pulled the ADD TO FAVORITES menu down and selected IMPORT AND EXPORT.

This launched an import wizard. I told it I was importing Favorites, and directed it to the .html file Chrome exported (#1), and told it to import to the CHROME BOOKMARKS folder I created (#2).

This created a .url file for each bookmark I had in Chrome which included both the BOOKMARKS BAR and the OTHER BOOKMARKS.

I tested and confirmed that a .URL file is launched in Chrome by double clicking or by drag and drop.

You can import the .URL files into Chrome, too. Leave the CHROME BOOKMARKS folder in your User\Favorites folder and then in Chrome click OTHER BOOKMARKS | IMPORTED FROM IE. I think you can also do this in Chrome's Settings | USERS | Import Bookmarks and Settings, but I did not try this.

Share:
1,711

Related videos on Youtube

Vladyslav Zavalykhatko
Author by

Vladyslav Zavalykhatko

Updated on September 18, 2022

Comments

  • Vladyslav Zavalykhatko
    Vladyslav Zavalykhatko over 1 year

    I'm trying to create custom button. For this, I wrapped my existed view into TouchableHighlight (write me please another way, if it's not suitable here)

    <TouchableHighlight onPress={this.freeTimeTapped} underlayColor="white">
        <LabelsView data={this.freeTimeData} 
                    containerStyle={{ backgroundColor: '#3A65FF' }} />
    </TouchableHighlight>
    

    This code throws an error touchable child must either be native, described here, for example. So, I added

    setNativeProps = (nativeProps) => {
        this._root.setNativeProps(nativeProps);
    }
    

    error disappeared, but now I receive an error

    React Native Error: undefined is not an object (evaluating '_this._root.setNativeProps')

    after touch. What am I doing wrong?

    More code about LabelsView:

    export default class LabelsView extends Component {
        // Make TouchableHighlight wrapper work
        setNativeProps = (nativeProps) => {
            this._root.setNativeProps(nativeProps);
        }
    
        render() {
            return (
                <View style={[styles.container, this.props.containerStyle]}>
                    <View style={styles.leftContainer}>
                        <Text style={[styles.nameText, styles.textColor]}> {this.props.data.leftText} </Text>
                    </View>
                    <View style={styles.rightContainer}>
                        <Text style={[styles.durationText, styles.textColor]}> {this.props.data.rightTopText + ' hrs'} </Text>
                        <Text style={[styles.rangeText, styles.textColor]}> {this.props.data.rightBottomText} </Text>
                    </View>
                </View>
            );
        }
    }
    
    • HikeMike
      HikeMike over 11 years
      Open the HTML file and drag&drop every link to the desktop or a folder? Works in Firefox at least.
    • HikeMike
      HikeMike over 11 years
      Do you want real Windows shortcuts (.lnk) or just .url files (Internet Explorer's bookmarks format)?
    • amiregelz
      amiregelz over 11 years
      The Internet Shortcut extension (.url) is what I want. The drag&drop method works, but it would take me a while to do it manually. How can I speed things up? Also, I couldn't find out why I can't add description to the shortcuts after I've dropped them in the folder.
    • HikeMike
      HikeMike over 11 years
      Given that .url files are simple text files, it should be easy to write a script that converts links in an HTML file to .url files. Do you have Cygwin?
    • amiregelz
      amiregelz over 11 years
      Not at the moment, but I can install it.
    • HikeMike
      HikeMike over 11 years
      The following works like a charm on OS X based on a Safari bookmarks file, I don't have the batch scripting skills or a Cygwin ready to create a proper Windows solution. #/bin/bash BASEDIR='~/Desktop/bookmarks' ; IFS=$'\n' ; for line in $( grep -oi '<a .*</a>' "$1" ) ; do url=$( echo "$line" | sed 's|.*HREF="\(.*\)".*|\1|g' ) ; name=$( echo "$line" | sed 's|.*>\(.*\)</A>.*|\1|g;s|/||g' ) ; echo '[InternetShortcut]' > "$BASEDIR/$name.url" ; echo "URL=$url" >> "$BASEDIR/$name.url" ; done Reads the HTML file passed as first argument; writes shortcuts to ~/Desktop/bookmarks.
    • amiregelz
      amiregelz over 11 years
      I'm not sure how to use Cygwin to run this script on Windows.
    • HikeMike
      HikeMike over 11 years
      Take the entire thing, insert a linebreak after #!/bin/bash, change the value assigned to BASEDIR to an empty folder you prepared, and save as htmltourl.sh. Open the Cygwin shell, run chmod +x /path/to/htmltourl.sh, then /path/to/htmltourl.sh /cygdrive/c/path/to/bookmarks.html. If you could provide a Chrome bookmark HTML file, I could can adapt the script if necessary.
    • Akshay Rao
      Akshay Rao over 6 years
      what are you doing in "LabelsView" ? Please show the code for it ?
    • Vladyslav Zavalykhatko
      Vladyslav Zavalykhatko over 6 years
      @AkshayRao, done
  • Andrestand
    Andrestand over 9 years
    Does it keep Chrome's bookmarks folder structure?
  • Vladyslav Zavalykhatko
    Vladyslav Zavalykhatko over 6 years
    yes, it's nice workaround. however, I wander how to actually do wrapper inside parent. with your code every LavelsView instance will have touch, which I don't want