I have a very large number of bookmarks in Google Chrome. I want to transfer all of them to a windows folder, so that each bookmark will be a shortcut to a website (I want a list of shortcuts, just like any list of regular applications shortcuts). I also would like to preserve the bookmark's name and icon.
I searched for a way to achieve my goal, but all I could find is to either manually
Create application shortcuts
Export bookmarks to HTML file
<DT><A HREF="http://data.stackexchange.com/" ADD_DATE="1342120101" ICON="data:image/png;base64,iVBORw0......">Stack Exchange</A>
<DT><A HREF="http://www.istockphoto.com/" ADD_DATE="1285715116" ICON="data:image/png;base64,iVBORw0.......">Web Design</A>
<DT><A HREF="http://icons.mysitemyway.com/" ADD_DATE="1287435657" ICON="data:image/png;base64,iVBORw0........">Ico.etc</A>
<DT><A HREF="http://www.shutterstock.com/" ADD_DATE="1285715294" ICON="data:image/png;base64,iVBORw0.....">Shutterstock</A>
Hmm, in combination with a tool like everything that would be usefull, only you will need to do the operation regularly. I suppose it must be possible to get your source right from chrome, anyway here is a script that does what you ask for.
Const ForReading = 1, ForWriting = 2, ForAppending = 8, CreateIfNeeded = true outpath = "g:\script\shortcut\url2\" Set objFSO = CreateObject("Scripting.FileSystemObject") bookmarkfile = "bookmarks.html" Set bookmarks = objFSO.OpenTextFile(bookmarkfile, ForReading) Set regEx = New RegExp regEx.Global = True Set regEx2 = New RegExp regEx2.Global = True regEx2.Pattern = "[^a-zA-Z0-9-_.]" regEx.Pattern = "<DT><A HREF=""(.*)"" ADD_DATE.*>(.*)</A>" do until bookmarks.AtEndOfStream line = bookmarks.readline() if regEx.test(line) then shortcut = regEx.Replace(line,"$1") filename = trim(regEx.Replace(line,"$2")) filename = Regex2.Replace(filename, "_") filename = outpath & left(filename, 80) & ".url" wscript.echo filename 'the following skips invalid filenames, you should add a routine to filter out invalid filename characters in your codeset on error resume next Set objFile = objFSO.OpenTextFile(filename, ForWriting, CreateIfNeeded) if err.number <> 0 then wscript.echo err.description end if objFile.write "[InternetShortcut]" & vbcrlf & "URL=" & shortcut objFile.close end if loop