Jump to content

Html Previewer


 Share

Recommended Posts

Hey guys

i need some help here maybe alot hehe

i got a folder called templates with a whole bunch of different html templates in folders soo the structure is C:\template\temp1 for example

i am trying to make a script that will give a list of all the sub folders in the templates folder

and then when you click preview will open the index.html in a preview box

any idea on how to do this

thanx

http://sparticus.webhop.net

Link to comment
Share on other sites

Make a GUI including one listbox and one embedded internet explorer window.

Populate the listbox with folder names you find in the selected directory.

On click of the listbox item:

Navigate the embedded IE window to the index.html of the folder selected in the listbox.

hey man how do i populate the listbox

thats the part i am having trouble with (shoudl have said that)

http://sparticus.webhop.net

Link to comment
Share on other sites

Func set_list()
    $prelist = _FileListToArray (@HomePath &"\Templates\") ; list files to an array.
    If (Not IsArray($prelist)) Or (@error = 1) Then
        MsgBox(262208, "Preview Error", "No Files\Folders Found.   ", 5)
        Return
    EndIf
    GUICtrlSetData($list1, "") ; set list to empty.
    For $x = 1 To $list1[0] ; for loop to place the files in the list.
        GUICtrlSetData($list1, (StringTrimRight($prelist[$x], 4)) & "|", 1) ; string trim the last 4 characters ( .txt )
    Next
EndFunc

i tried that but i get the message no files/folder all the time

Edited by silurian

http://sparticus.webhop.net

Link to comment
Share on other sites

i checked again and yup it does

but the directory C:\Templates is full of sub folders

not sure if theat causes a problem with _FileListToArray or not

i am also trying to do it with the findfisrtfile thing but not sure how to use that lol

btw thanx for the help so far

heres a link to the full code so far maybe that will help too

http://pastebin.com/m443f2126

also have changed line 44 to

$prelist = _FileListToArray (@HomePath &"\Templates") ; list files to an array.

Edited by silurian

http://sparticus.webhop.net

Link to comment
Share on other sites

no, the director @HomePath & "\Templates\" does not exist, he got confused and used @HomePath imstead of @HomeDrive, which is the change to make the script work, except this:

For $x = 1 To $list1[0] ; for loop to place the files in the list.
        GUICtrlSetData($list1, (StringTrimRight($prelist[$x], 4)) & "|", 1) ; string trim the last 4 characters ( .txt )
    Next

should be

For $x = 1 To $prelist[0] ; for loop to place the files in the list.
        GUICtrlSetData($list1, (StringTrimRight($prelist[$x], 4)) & "|", 1) ; string trim the last 4 characters ( .txt )
    Next
Link to comment
Share on other sites

Another Update

Final Code

YAY finished and working

see code attached

can anyone help me with adding a option to change path

i have done the menus but not sure on how to go about setting the path

also if i added this option i would need to add an INI file to save and read the path from

any help would be awsome thanx again guys

Edited by silurian

http://sparticus.webhop.net

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...