Source language: Translate to:

How to Access user's IE Favorites?

Questions and information about creating Internet aware NeoBook applications. Including PHP, HTML, FTP, HTTP, Email, etc.

Moderator: Neosoft Support

How to Access user's IE Favorites?

Postby fkapnist » Fri Aug 21, 2015 3:42 am

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?

:?:
.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: How to Access user's IE Favorites?

Postby fkapnist » Fri Aug 21, 2015 4:27 am

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

.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: How to Access user's IE Favorites?

Postby Neosoft Support » Fri Aug 21, 2015 12:02 pm

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.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: How to Access user's IE Favorites?

Postby fkapnist » Sat Aug 22, 2015 3:57 am

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:

.
Last edited by fkapnist on Sat Aug 22, 2015 1:40 pm, edited 2 times in total.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: How to Access user's IE Favorites?

Postby Neosoft Support » Sat Aug 22, 2015 11:12 am

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
...
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBook and the Internet

Who is online

Users browsing this forum: No registered users and 1 guest