Page 1 of 1

How to Access user's IE Favorites?

PostPosted: Fri Aug 21, 2015 3:42 am
by fkapnist
I wonder if anyone has found a way for the Neobook browser-object to add and open an item to and from the user's IE Favorites folder? (Although Microsoft claims ease of use, it is mostly propriety -based, for its own Windows applications)... maybe a VB script?

:?:
.

Re: How to Access user's IE Favorites?

PostPosted: Fri Aug 21, 2015 4:27 am
by fkapnist
fkapnist wrote:I wonder if anyone has found a way for the Neobook browser-object to add and open an item to and from the user's IE Favorites folder? (Although Microsoft claims ease of use, it is mostly propriety -based, for its own Windows applications)...

:?:
.


The Following by Jim Brammer works pretty good when adding to Favorites list (but change the Google var to your current URL)

SetVar "[Title]" "Google"
SetVar "[URL]" "http://google.com/"

FileWrite "C:\Users\[UserName]\Favorites\[Title].URL" "1" "[#91]DEFAULT[#93]"
FileWrite "C:\Users\[UserName]\Favorites\[Title].URL" "Append" "BASEURL=[URL]"
FileWrite "C:\Users\[UserName]\Favorites\[Title].URL" "Append" ""
FileWrite "C:\Users\[UserName]\Favorites\[Title].URL" "Append" "[#91]InternetShortcut[#93]"
FileWrite "C:\Users\[UserName]\Favorites\[Title].URL" "Append" "URL=[URL]"
FileWrite "C:\Users\[UserName]\Favorites\[Title].URL" "Append" ""


(Now I need another function to open the Favorites list and select an item)

:o

.

Re: How to Access user's IE Favorites?

PostPosted: Fri Aug 21, 2015 12:02 pm
by Neosoft Support
You could use the FileList action:

FileList "C:\Users\[UserName]\Favorites\*.url" "Files+NoExt" "[Favorites]"

The NeoBookFM/FTP plug-in has more options for listing and selecting files.

Re: How to Access user's IE Favorites?

PostPosted: Sat Aug 22, 2015 3:57 am
by fkapnist
Neosoft Support wrote:You could use the FileList action:

FileList "C:\Users\[UserName]\Favorites\*.url" "Files+NoExt" "[Favorites]"

The NeoBookFM/FTP plug-in has more options for listing and selecting files.


This path in the Neosoft Support example: C:\Users\[UserName]\Favorites\*.url
makes a list of favorites titles, not their URLs. How do I get a list of the actual links?

Microsoft doesn't offer an API to access the explorer bookmarks structure. But some useful info is found here:
http://www.codeproject.com/Articles/22267/Internet-Explorer-Favorites-deconstructed


Here is an easy solution I just did.
The favorites titles are actually file names that end with ".url"
In this example the favorites are listed in ComboBox3.
Search for the string "URL=" and FileWrite it as tmp.txt file.
Then FileRead back only the 1st line of tmp.txt.
Replace URL= and all quotation marks with nothing.
Then send the new string to be opened in WebBrowser1.

Code: Select all
FileRead "C:\Users\[UserName]\Favorites\[ComboBox3].url" "All" "[vfav]"
.Delay "100"
SearchStr "URL=" "[vfav]" "[vfavUrl]" "CaseSensitive"
.Delay "100"
SubStr "[vfav]" "[vfavUrl]" "1500" "[vfavNumber]"
FileWrite "[TempDir]tmp.txt" "All" "[vfavNumber]"
FileRead "[TempDir]tmp.txt" "1" "[vfavURL]"
.Delay "100""
StrReplace "[#34][vfavURL][#34]" "URL=" "" "[vfavFav]" "CaseSensitive"
.Delay "100"
StrReplace "[vfavFav]" "[#34]" "" "[vfavUrlanswer]" ""
.Delay "100"
SetVar "[TextEntry1]" "[vfavUrlanswer]"
BrowserGoTo "WebBrowser1" "[TextEntry1]"



:arrow:

.

Re: How to Access user's IE Favorites?

PostPosted: Sat Aug 22, 2015 11:12 am
by Neosoft Support
How do I get a list of the actual links?


You have to read the files and parse them. The url files are plain text so you can read them with FileRead or FileToVar and use SearchStr to locate the line containing the url.

Sample favorite file:
Code: Select all
[DEFAULT]
BASEURL=http://www.networksolutions.com/whois/index.jsp
[InternetShortcut]
URL=http://www.networksolutions.com/whois/index.jsp
IDList=
IconFile=http://www.networksolutions.com/favicon.ico
...