Sign in to follow this  
Followers 0
Nigel

Script that creates a .txt file

6 posts in this topic

Hello, I am wondering how to make an autoit script that would create a .txt file.

Such as having an inputbox, and whatever you enter into the inputbox is put into the .txt file.

Share this post


Link to post
Share on other sites



FileWrite("test.txt", InputBox("Enter something", "Enter something"))

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi Nigel.

In its simplest form you would use the functions

While 1

$textToWrite = InputBox ( "title", "Prompt" [, "Default" [, "password char" [, width, height [, left, top [, timeOut [, hwnd]]]]]] )

FileWriteLine ( filehandle or "filename", $textToWrite )

Wend

Something like

Global $file=@DesktopDir&"\File.txt"
Global $TextToWrite

While 1
    $TextToWrite = InputBox ( "Write Stuff", "What do you want me to write?" )
    FileWriteLine ($file,$TextToWrite)
WEnd

Cheers

NBJ

edit: bugger too slow!

Edited by NBJ

Share this post


Link to post
Share on other sites

Thank you so much both of you :-)

Is there anyway to make a box read a .txt file?

Example:

I have test.txt on my desktop.

I want to have a script that will have a Msgbox read it, if that makes sense :)

Share this post


Link to post
Share on other sites

Try the FileRead function.

Share this post


Link to post
Share on other sites

Alright, thanks for the help NBJ :-)!

Share this post


Link to post
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
Sign in to follow this  
Followers 0