For example, can FileAppend() be set to create something like %COMPUTERNAME%test.txt? I have no idea of what the code for this would be like, if so.

  • SpikesOtherDog@ani.social
    link
    fedilink
    arrow-up
    0
    ·
    27 days ago

    FileAppend is to write data to the end of a file.

    If your computer name is Alice, then

    FileAppend A_ComputerName, "Helloworld.txt"

    This changes the text of HelloWorld.Txt to

    "Hello World.

    Alice"

    Where Helloworld.txt will (probably) be in the same folder as your script.

    You are asking about the file name, which would be

    FileAppend "asdf", A_Computername . " Helloworld.txt"

    Filename:

    “Alice Helloworld.txt”

    Text:

    "Hello World

    asdf"

    FileAppend does create a file, so you can just start calling the file and appending to it with the same command:

    MyData := “GIGOasdfasdfasdfasdf” MyPath:= "C:\OutputFolder" . A_Computername

    FileAppend MyData, MyPath, `n