Write text file question

Post here if you need help using Actiona
Post Reply
linnabeba
Posts: 1
Joined: 25 May 2012, 14:50

Write text file question

Post by linnabeba »

Hello. I'm trying to create a log txt file for my program. And I'm using write text file function that writes text to logs.txt file.
What it does is writes text next to it, like:

Code: Select all

 program has started program entered main menu
and I want it to do it in new lines like:

Code: Select all

program has started
program entered main menu
so it can be more clear to read, when each write to text file is in new line.

Here is copy of script:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<scriptfile>
    <settings program="actionaz" version="3.4.1" scriptVersion="1.0.0" os="Windows"/>
    <actions>
        <action name="ActionWriteTextFile" version="1.0.0"/>
    </actions>
    <parameters/>
    <script pauseBefore="0" pauseAfter="0">
        <action name="ActionWriteTextFile">
            <exception id="0" action="0" line=""/>
            <exception id="1" action="0" line=""/>
            <exception id="2" action="1" line=""/>
            <exception id="32" action="0" line=""/>
            <parameter name="mode">
                <subParameter name="value" code="0">append</subParameter>
            </parameter>
            <parameter name="file">
                <subParameter name="value" code="0">logs.txt</subParameter>
            </parameter>
            <parameter name="text">
                <subParameter name="value" code="0">Program has started</subParameter>
            </parameter>
        </action>
        <action name="ActionWriteTextFile">
            <exception id="0" action="0" line=""/>
            <exception id="1" action="0" line=""/>
            <exception id="2" action="1" line=""/>
            <exception id="32" action="0" line=""/>
            <parameter name="mode">
                <subParameter name="value" code="0">append</subParameter>
            </parameter>
            <parameter name="file">
                <subParameter name="value" code="0">logs.txt</subParameter>
            </parameter>
            <parameter name="text">
                <subParameter name="value" code="0">Program entered main menu</subParameter>
            </parameter>
        </action>
    </script>
</scriptfile>
Thank you :)
User avatar
Jmgr
Admin
Posts: 1651
Joined: 07 Dec 2005, 15:45
Contact:

Re: Write text file question

Post by Jmgr »

Hi,
You could try that:
- put the "text" field in text mode (red triangle)
- put the text between quotes "
- add \n at the end of your text, this will create a new line

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<scriptfile>
    <settings program="actionaz" version="3.2.2" scriptVersion="1.0.0" os="GNU/Linux"/>
    <actions>
        <action name="ActionWriteTextFile" version="1.0.0"/>
    </actions>
    <parameters/>
    <script pauseBefore="0" pauseAfter="0">
        <action name="ActionWriteTextFile">
            <exception id="0" action="0" line=""/>
            <exception id="1" action="0" line=""/>
            <exception id="2" action="1" line=""/>
            <exception id="32" action="0" line=""/>
            <parameter name="mode">
                <subParameter name="value" code="0">append</subParameter>
            </parameter>
            <parameter name="file">
                <subParameter name="value" code="0">logs.txt</subParameter>
            </parameter>
            <parameter name="text">
                <subParameter name="value" code="1">"Program has started\n"</subParameter>
            </parameter>
        </action>
        <action name="ActionWriteTextFile">
            <exception id="0" action="0" line=""/>
            <exception id="1" action="0" line=""/>
            <exception id="2" action="1" line=""/>
            <exception id="32" action="0" line=""/>
            <parameter name="mode">
                <subParameter name="value" code="0">append</subParameter>
            </parameter>
            <parameter name="file">
                <subParameter name="value" code="0">logs.txt</subParameter>
            </parameter>
            <parameter name="text">
                <subParameter name="value" code="1">"Program entered main menu\n"</subParameter>
            </parameter>
        </action>
    </script>
</scriptfile>
"My software never has bugs. It just develops random features."
Post Reply