What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Trying to write on a .txt file

Trying to write on a .txt file
Author: Message:
iklipxe
New Member
*


Posts: 4
Joined: Jan 2008
O.P. Trying to write on a .txt file
Hello,

first sorry my english (i'm portuguese)

I have this code:

code:
function AddLineToFile(file, line)
{
    if (!fsObj.FileExists(MsgPlus.ScriptFilesPath + '\\' + file))
        var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 2, 1);
    else
        var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 8, 0);
    fileObj.WriteLine(line);
    fileObj.Close();
}

that i took from here

and in the debug it say's that fsObj doesn't exist :S what am i doing wrong?
01-13-2008 09:24 PM
Profile E-Mail PM Find Quote Report
Dheano
New Member
*

I shall overcome

Posts: 11
30 / Male / Flag
Joined: Dec 2007
RE: Trying to write on a .txt file
Are you selecting "All Files" when saving, then naming it *.js ?
01-13-2008 09:46 PM
Profile E-Mail PM Web Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
RE: Trying to write on a .txt file
add at the top:
code:
var fsObj = new ActiveXObject("Scripting.FileSystemObject");
[quote]
Ultimatess6
: What a noob mod
01-13-2008 09:51 PM
Profile PM Web Find Quote Report
iklipxe
New Member
*


Posts: 4
Joined: Jan 2008
O.P. RE: Trying to write on a .txt file
thanks roflmao456 it works :P
01-13-2008 09:53 PM
Profile E-Mail PM Find Quote Report
iklipxe
New Member
*


Posts: 4
Joined: Jan 2008
O.P. RE: Trying to write on a .txt file
btw what's wrong here:

code:
<?xml version="1.0" encoding="UTF-16"?>
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd" Name="Demo Script Windows">
<Window Id="windowZero" Version="1">
<Position Width="114" Height="128" />

        <Attributes>
            <Caption>Test Window</Caption>
        </Attributes>
        <TitleBar>
            <Title><Text>Hello!</Text></Title>
        </TitleBar>
        <Controls>
            <Control xsi:type="ListBoxControl" Id="list">
                <Position Top="37" Width="0" Left="26" />
            </Control>
            <Control xsi:type="ButtonControl" Id="btnAdd">
                <Position Top="37" Width="0" Left="26" />
                <Caption>Adicionar</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="btnRem">
                <Position Top="80" Width="0" Left="190" />
                <Caption>Remover</Caption>
            </Control>
            <Control xsi:type="StaticControl" Id="static1">
                <Position Top="37" Width="0" Left="26" />
                <Caption>Made by zeroonnet</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>

i use var Wnd = MsgPlus.CreateWnd("zero.xml", "windowZero"); to open but nothing append's :S
01-13-2008 10:42 PM
Profile E-Mail PM Find Quote Report
davidpolitis
Full Member
***


Posts: 371
Reputation: 16
Joined: Aug 2006
RE: RE: Trying to write on a .txt file
quote:
Originally posted by iklipxe
code:
<?xml version="1.0" encoding="UTF-16"?>
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd" Name="Demo Script Windows">
<Window Id="windowZero" Version="1">
<Position Width="114" Height="128" />

        <Attributes>
            <Caption>Test Window</Caption>
        </Attributes>
        <TitleBar>
            <Title><Text>Hello!</Text></Title>
        </TitleBar>
        <Controls>
            <Control xsi:type="ListBoxControl" Id="list">
                <Position Top="37" Width="0" Left="26" />
            </Control>
            <Control xsi:type="ButtonControl" Id="btnAdd">
                <Position Top="37" Width="0" Left="26" />
                <Caption>Adicionar</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="btnRem">
                <Position Top="80" Width="0" Left="190" />
                <Caption>Remover</Caption>
            </Control>
            <Control xsi:type="StaticControl" Id="static1">
                <Position Top="37" Width="0" Left="26" />
                <Caption>Made by zeroonnet</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>

Change the positioning and remove all instances of Width="0"?

This post was edited on 01-14-2008 at 04:41 AM by davidpolitis.
01-14-2008 04:36 AM
Profile PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
RE: Trying to write on a .txt file
open the file in notepad, and press File > Save As

then in the Encoding dropdown box, you select Unicode
[quote]
Ultimatess6
: What a noob mod
01-14-2008 01:10 PM
Profile PM Web Find Quote Report
iklipxe
New Member
*


Posts: 4
Joined: Jan 2008
O.P. RE: Trying to write on a .txt file
i've saved with unicode and removed the width="0" and the window apears without controls :S

code:
<?xml version="1.0" encoding="UTF-16"?>
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd" Name="Demo Script Windows">
    <Window Id="windowZero" Version="1">
        <Position Width="114" Height="128" />
        <Attributes>
            <Caption>Test Window</Caption>
            </Attributes>
        <TitleBar>
            <Title><Text>Hello!</Text></Title>
        </TitleBar>
        <Controls>
            <Control xsi:type="ListBoxControl" Id="list">
                <Position Top="37" Left="26" />
            </Control>
            <Control xsi:type="ButtonControl" Id="btnAdd">
                <Position Top="37" Left="26" />
                <Caption>Adicionar</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="btnRem">
                <Position Top="80" Left="190" />
                <Caption>Remover</Caption>
            </Control>
            <Control xsi:type="StaticControl" Id="static1">
                <Position Top="37" Left="26" />
                <Caption>Made by zeroonnet</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>

What's wrong?
01-14-2008 10:57 PM
Profile E-Mail PM Find Quote Report
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
RE: RE: Trying to write on a .txt file
quote:
Originally posted by iklipxe
i've saved with unicode and removed the width="0" and the window apears without controls :S
Put the widths back in and give them a proper value (something above 0). Having them all set at 0 means just that; they have no width so you wont see anything :P
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
01-14-2008 11:17 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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