Jump to content

open new text document


Recommended Posts

If i want it to open a new text file when i push F1, why doesnt this work?

HotKeySet("{F1}", "NewTextFile")

While 1
     sleep(100)
WEnd

Func NewTextFile()
    $file = FileOpen("file.txt", 33)
    Local $var = "Test"

    If $file = -1 Then
        FileOpen("file.txt", 2)
        WinWaitActive("file.txt")
        sleep(500)
        ConsoleWrite("var=" & $var & @CRLF)
    EndIf
        
EndFunc
Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

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