What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [HELP]File listing and getting it to work

[HELP]File listing and getting it to work
Author: Message:
Vector
New Member
*


Posts: 3
Joined: Aug 2006
O.P. Roll Eyes  [HELP]File listing and getting it to work
hi there!
i'm realy new to mpl! scripting and i need some help with getting this to work :)

i got it from mpscripts.net

i'm trying to list out the files from directory, and send the list of files in the chat.

this is what i got yet:


function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
    if(Message.match("^!list"))
    {
        var folder = Message.substr(6);
        var type = "1"
        //ChatWnd.SendMessage(folder);
        var stuff = ListFolders();
        ChatWnd.SendMessage(stuff);
    }
}

//Folder = folder to read files from
//Type: 0 = Full Path; 1 = Filename Only
//Returns array if files found otherwise false
function ListFiles(folder,type) {
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var dirFiles = new Array();
    if(fso.FolderExists(folder)) {
        f = fso.GetFolder(folder);
        files = new Enumerator(f.Files);
        if(files.atEnd()) return false;
        for (var i = 0; !files.atEnd(); files.moveNext())
        {
            if(type == 1)
                dirFiles[i++] = files.item();
            else {
                var temp = "" + files.item();
                var index = temp.lastIndexOf("\\");
                dirFiles[i++] = temp.substr(index+1);
            }
        }
        return dirFiles;
    } else
        return false;
}

i know that there are several thing i'm doing wrong but that is why i'm asking for some help :)

sry for my english and thank you..

This post was edited on 08-28-2006 at 09:55 PM by Vector.
08-28-2006 09:52 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[HELP]File listing and getting it to work - by Vector on 08-28-2006 at 09:52 PM
RE: [HELP]File listing and getting it to work - by Silentdragon on 08-28-2006 at 10:16 PM
RE: [HELP]File listing and getting it to work - by Vector on 08-29-2006 at 09:46 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On