Jump to content

FileWrite


Nino
 Share

Recommended Posts

FileWrite($2 & ".txt", $3)

The file is written to my desktop, but I want it written into a folder on my desktop. I tried to do the following, but it didn't work.

FileWrite("C:\Documents and Settings\NAME\Desktop\FOLDER\"$2 & ".txt", $3)

Is there a way to customize the directory for the file to be written to?

Thanks for any help.

Link to comment
Share on other sites

FileWrite("C:\Documents and Settings\NAME\Desktop\FOLDER\"& $2 & ".txt", $3)

It works, but using $2 or $3 are horrible variable names, as I have know idea what they represent. $filename and $line have more meaning.

Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Link to comment
Share on other sites

Awesome thank you for your help! I also have another question now, if I wanted to label a file name with the current time using the (F5) button, would it simply be...

FileWrite("C:\Documents and Settings\NAME\Desktop\FOLDER\"&(F5) & ".txt", $line)

I know its possible in Send() commands because I do remember reading it in the help file, but I don't know how you can encorporate it into other things, I know about the @MDAY, @HOUR etc, but that just seems sloppy because 12 is 00, and its like navy time.

Once again, thank you for any help. :(

Edited by Nino
Link to comment
Share on other sites

Simply minus 12 hours off the Hour. Example Function

Func _12Hour_Time()
   $24 = @Hour - 12
   $Time = $24 & ":" & @Min & ":" & @Sec
   Return $Time
EndFunc

Example script.

#include <GUIConstants.au3>

GUICreate("My GUI")

$test = GUICtrlCreateLabel (_12Hour_Time(),  10, 30, 50)

GUISetState ()

While 1
    $msg = GUIGetMsg()
    GUICtrlSetData ($test,_12Hour_Time())
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Func _12Hour_Time()
   $24 = @Hour - 12
   $Time = $24 & ":" & @Min & ":" & @Sec
   Return $Time
EndFunc

qq

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...