Jump to content

Problems with AU3 Record


Recommended Posts

Hi there,

Can anyone help me with this AU3 Record...I want to use it for auto installs...however when I tried even a basic function, it seemed to fail on just that. For instance, I recorded the macro for opening Notepad, typing some text in and then closing notepad...it created the script below:

Run('C:\WINDOWS\notepad.exe')

_WinWaitActivate("Untitled - Notepad","")

Send("{SHIFTDOWN}t{SHIFTUP}est{SPACE}{SHIFTDOWN}f{SHIFTUP}ile")

MouseClick("left",791,15,1)

_WinWaitActivate("Notepad","")

MouseClick("left",143,105,1)

AutoIT did not seem to understand the command _WinWaitActivate. So I changed it to just "WinWaitActive".

On one PC, it seemed to work fine, opened notepad and typed the text in and closed it. On another PC, notepad opened, but nothing happened and I noticed the Notepad application was not in focus. I click on notepad and then the script started to run but clicked around the screen all over the place. On another computer, the script seemed to half stop because again the notepad window was not in focus, I closed notepad, then opened it again and this seemed to set the mouse of again clicking around all over the machine.

Appreciate your kind help with this since I am a newbie and struggling.

THanks

Jackie

Link to comment
Share on other sites

It appears you copied part of the generated script... there should have been a function created also. It is a robust and useful function... you should find it and use it.

Lar.

I was testing this yesterday and ran into the same issue. I finally did the same thing and changed to WinActivate.

I just recreated the same code for Notepad below. Still no go.

#region --- Au3Recorder generated code Start ---
_WinWaitActivate("Start Menu","")
MouseClick("left",6,410,1)
MouseClick("left",62,348,1)
MouseClick("left",344,-68,1)
")

#region --- Internal functions Au3Recorder Start ---
Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc
#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---
#endregion --- Au3Recorder generated code End ---
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...