Jump to content
Sign in to follow this  
teamdad

Button Help Needed Please

Recommended Posts

teamdad

What I am attempting seems so simple but I guess I can't put two and two together and come up with the code needed. What I need help with is a button in the GUI that will launch another program and do another action within that program.

GUICreate ("Program Master")

GuiSetControl("button","OK",50,70,70)
GuiSetControlNotify(2)

$val = RunWait("Notepad.exe", "C:\WINDOWS")
Send("Today's time/date is {F5}")

GUIWaitClose ()

The above works backwards. It launches Notepad and does nothing; when Notepad is closed it then launches the GUI with the button on it that also does nothing.

Any pointers for a lost soul ? :D

Share this post


Link to post
Share on other sites
Josbe

GUICreate ("Program Master")

$button1= GuiSetControl("button","OK",50,70,70)
GuiSetControlNotify()

While GUIMsg() <> 0
 If GUIRead() = $button1 Then
    Run("Notepad.exe")
    WinWaitActive("Untitled", "")
    ControlSend("Untitled", "", "Edit1", "Today's time/date is {F5}")
 EndIf
Wend

Look the changes.... :D

Share this post


Link to post
Share on other sites
teamdad

Something went wrong when I tried to run the script above.... I am using version 3.0.101.4 of the AutoIT-gui and get this error message.

Line 6

While GUIMsg() <>0

While ^ERROR

Error: Unknown function name.

Any other thoughts..... :D

Share this post


Link to post
Share on other sites
bobheart

Yes it work for me and thats what I'm using now .

Share this post


Link to post
Share on other sites
teamdad

Thanks for the insight to use the unstable update. LOL :D I guess sometimes it pays to be a little risky and not so stable all the time. It works perfect now!!!

Share this post


Link to post
Share on other sites
scriptkitty

Some of us are normally a little unstable :D


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites
sykes

Some of us are normally a little unstable  :huh2:

:D

We have enough youth. How about a fountain of SMART?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.