Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <html>
- <head>
- <HTA:APPLICATION
- ID="makeIndex"
- APPLICATIONNAME="makeIndex"
- SCROLL="no"
- SINGLEINSTANCE="yes"
- WINDOWSTATE="normal"
- MAXIMIZEBUTTON="no"
- BORDER="thin"
- DEBUG="true" />
- <title>Make Index</title>
- <script language="VBScript">
- '<![CDATA[
- ' EVENTS
- ' Sets up the window and other parameters when loaded
- Sub window_onload()
- ' Resizes the window
- window.resizeTo 420, 380
- End Sub
- Sub ErrorMsg(errmsg)
- MsgBox("ERROR: " + errmsg)
- End Sub
- Sub btnGetFiles_onClick()
- Dim FSO, FLD, FIL, LINKS
- If txtPath.Value <> "" Then
- Set FSO = CreateObject("Scripting.FileSystemObject")
- Set FLD = FSO.GetFolder(txtPath.value)
- LINKS = "<html><body><p>Files:</p>" + vbCrLf
- For Each FIL In FLD.Files
- LINKS = LINKS + "<a href=""" + FIL.Name+ """>" + FIL.Name + "</a><br>" + vbCrLf
- Next
- LINKS = LINKS + "</body></html>"
- txtHtml.Value = LINKS
- txtFileName.Value = txtPath.Value + "\index.html"
- End If
- End Sub
- Sub btnSaveFile_onClick()
- Dim FSO, OTF
- If txtFileName.Value <> "" Then
- Set FSO = CreateObject("Scripting.FileSystemObject")
- Set OTF = FSO.CreateTextFile(txtFileName.Value, True)
- OTF.WriteLine(txtHtml.Value)
- OTF.Close
- End If
- End Sub
- ']]>
- </script>
- <style type="text/css">
- body { background: #e0e0e0; }
- div { margin: 5px; }
- </style>
- </head>
- <body style="margin: 0px; padding: 0px;">
- <div>
- <input type="text" id="txtPath" style="width: 335px;" />
- <input type="button" id="btnGetFiles" value="Go" style="width: 35px;" />
- </div>
- <div>
- <textarea id="txtHtml" style="width:375px;height:250px;"></textarea>
- </div>
- <div>
- <input type="text" id="txtFileName" style="width: 325px;" />
- <input type="button" id="btnSaveFile" value="Save" style="width: 45px;" />
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement