A quick way to import favorites into this menu system...

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
Yellowg
Beginner
Beginner
Posts: 2
Joined: Sun Jun 09, 2002 8:23 am
Contact:

A quick way to import favorites into this menu system...

Post by Yellowg »

wrote a quick vbs..

just copy and paster into a .vbs file

how to run:
- have an empty folder
- put .vbs file there
- put a copy of the favorites folder there
- run .vbs
- output is favs.txt which you guys should be familiar with..

--snip--
Dim file, folder, makefile, makefilename, startfolder
public fso
Set fso = CreateObject("Scripting.FileSystemObject")

startfolder = fso.getfile(WScript.ScriptFullName).parentfolder & "\"
makefilename = fso.getfile(WScript.ScriptFullName).parentfolder & "\" & "favs.txt"

fso.deletefile makefilename, true
set makeFile = fso.CreateTextFile(makefilename, True)

subfolderlist(fso.Getfolder(startfolder))

makefile.close
set makefile = Nothing


'-----
Sub subfolderlist(folder)

Dim subfolder

filelist(folder)
For Each subfolder in folder.SubFolders

makefile.Writeline "addmenu(menu=[""" & replace(mid(subfolder.path,len(startfolder)+1,len(subfolder.path)-len(startfolder)+1),"\","_") & "_MENU" & ""","
makefile.Writeline ",,,1,,style1,,""left"",effect,,,,,,,,,,,,"
listwrite(subfolder)
subfolderlist(subfolder)

Next

End Sub
'-----


'-----
Sub listwrite(folder)

Dim subfolder

For Each subfolder in folder.SubFolders
makefile.Writeline ",""" & replace(mid(subfolder.path,len(folder.path)+2,len(subfolder.path)-len(folder.path)+2),"\","_") & "  "",""show-menu=" & replace(mid(subfolder.path,len(startfolder)+1,len(subfolder.path)-len(startfolder)+1),"\","_") & "_MENU" & """,,"""",0"
Next

End Sub
'-----

'-----
Sub filelist(folder)

Dim file
Dim urlfile
dim url
dim z

z=0
For Each file in folder.Files

if ucase(right(file.Name,4)) = ".URL" then

z=1

Set urlfile = fso.opentextfile(file.path,1)
urlfile.skipline
url = urlfile.ReadLine

if len(file.name) < 32 then
makefile.Writeline ",""" & mid(file.name,1,len(file.name)-4) & """,""" & mid(url, 9, len(url)-8) & """,,,0"
else
makefile.Writeline ",""" & left(mid(file.name,1,len(file.name)-4),32) & "..." & """,""" & mid(url, 9, len(url)-8) & """,,,0"
end if

end if

Next

if z <> 0 then
makefile.Writeline "])"
makefile.Writeline ""
end if

End Sub
'-----

--snip--
Gear Head
Beginner
Beginner
Posts: 2
Joined: Thu Jul 11, 2002 6:45 am

VBS Not Working.

Post by Gear Head »

I am getting an error on line 68, Char. 96 :?
I'm not a vbs guy, please help.

This looks like it could be very useful for creating the menu structure for the Milonic menu and I can't wait to try it. 8)
Gear Head
Beginner
Beginner
Posts: 2
Joined: Thu Jul 11, 2002 6:45 am

Disable Smiles

Post by Gear Head »

I realize that you forgot to disable smiles in your post, so when the code said 8) The forum thought it was a "cool smile". This, of course, did not paste into my vbs file.

NOW... When I replace those blank spaces with 8) it starts to run the code, but then gives me an error...

Line 8
Char. 1
File not found.
Post Reply