Sign in to follow this  
Followers 0
Timothy09

AU3record-recorded-but fails to run-get "Script Paused"

5 posts in this topic

I am new to AUTOIT.

I launched the Au3record, start record, move the mouse to 'Start' -> 'Run" type 'cmd' then 'ping local host'

move the mouse to 'Start' -> 'Run' type 'calc' click 12 * 3 = then stop record.

Save file test.au3 on desktop.

doubled click on test.au3 noticed that in the bottom right taskbar auto-log, click on that see 'Script Paused' is checked and cannot be unchecked, 'Exit', Try to run test.au3 again, same thing.

ANy help?

Here is the recored script:

#region --- Au3Recorder generated code Start ---

_WinWaitActivate("classname=Shell_TrayWnd","")

MouseClick("left",22,20,1)

MouseClick("left",84,-50,1)

_WinWaitActivate("Run","")

Send("{ENTER}")

_WinWaitActivate("C:\WINDOWS\system32\cmd.exe","")

Send("ping{SPACE}localhost{ENTER}")

_WinWaitActivate("classname=Shell_TrayWnd","")

MouseClick("left",51,17,1)

MouseClick("left",85,-49,1)

_WinWaitActivate("Run","")

Send("calc{ENTER}")

_WinWaitActivate("Calculator","")

MouseClick("left",81,199,1)

MouseClick("left",107,204,1)

MouseClick("left",188,168,1)

MouseClick("left",156,211,1)

MouseClick("left",225,236,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 ---

Share this post


Link to post
Share on other sites



Hi Timothy09,

#region --- Au3Recorder generated code Start ---

_WinWaitActivate("classname=Shell_TrayWnd","")

The 1st line is waiting for a window, which I guess would be the startmenu that you have at the top of your screen? Start the script and then press the keyboard key with the windows icon on it. See if it starts to work then.

MouseClick("left",22,20,1)

MouseClick("left",84,-50,1)

_WinWaitActivate("Run","")

Send("{ENTER}")

For some reason that you described, the last line above is missing the chars "cmd". So try adding "cmd" into the function parameter like below.

Send("cmd{ENTER}")

And the rest below looks kind of OK.

_WinWaitActivate("C:\WINDOWS\system32\cmd.exe","")

Send("ping{SPACE}localhost{ENTER}")

_WinWaitActivate("classname=Shell_TrayWnd","")

MouseClick("left",51,17,1)

MouseClick("left",85,-49,1)

_WinWaitActivate("Run","")

Send("calc{ENTER}")

_WinWaitActivate("Calculator","")

MouseClick("left",81,199,1)

MouseClick("left",107,204,1)

MouseClick("left",188,168,1)

MouseClick("left",156,211,1)

MouseClick("left",225,236,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 ---

Have you got multiple monitors? as you have some negative values for the MouseClicks that I would not normally expect on a single monitor system.

:mellow:

Share this post


Link to post
Share on other sites

Thanks MHz.

The last post, I tried to clean up before post. Here I just tried to au3record again, saved and opened with SciTE (nothing altered):

#region ---Au3Recorder generated code Start ---

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

_WinWaitActivate("classname=Shell_TrayWnd","Running Applications")

MouseClick("left",48,17,1)

MouseClick("left",95,-55,1)

_WinWaitActivate("Run")

Send("cmd{ENTER}")

_WinWaitActivate("C:\WINDOWS\system32\cmd.exe","")

Send("ping{SPACE}localhost{ENTER}")

_WinWaitActivate("classname=Shell_TrayWnd","Running Applications")

MouseClick("left",53,18,1)

MouseClick("left",79,-46,1)

_WinWaitActivate("Run","Type the name of a p")

Send("cl{BACKSPACE}alc{ENTER}")

_WinWaitActivate("Calculator","Backspace")

MouseClick("left",77,205,1)

MouseMove(108,199)

MouseDown("left")

MouseMove(109,199)

MouseUp("left")

MouseClick("left",183,167,1)

MouseMove(158,168)

MouseDown("left")

MouseMove(158,167)

MouseUp("left")

MouseClick("left",229,237,1)

MouseMove(244,18)

MouseDown("left")

MouseMove(244,17)

MouseUp("left")

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

-- IF I run it, I have same problem - Script Paused --

--------------- This is a good concept ---------

As demo on youtube, it seems to be very simple and easy.

--------------

Can some you from Developers, please just try this simple steps:

1: Launch au3recor

2: select / check mark 3 options

3: click Start record

4: move the mouse to 'Start' and click on it

4a: backspace till it empty

5: type cmd hit <enter>

6: type ping localhost

(assumed that you have connected to any network and have any IP address)

(sometimes you type wrong, should backspace, type correctly as ping localhost )

7: move the mouse to 'Start' and click on it

7a: backspace till it empty

8: type calc hit <enter>

9: click on 1 then 2 then * then 6 then =

10: move the mouse to and clock on 'x' to close calc

11: move the mouse to 'Stop' record

12: save the record and try to run it

--------------------------------

I am sure this is very simple to script manually. but to if autoit offers au3record, it should work.

It would have much less value to have recorded the to edit/correct as for this so simple steps

thanks. Tim

Share this post


Link to post
Share on other sites

I am sure this is very simple to script manually. but to if autoit offers au3record, it should work.

It would have much less value to have recorded the to edit/correct as for this so simple steps

It works only doesn't perform magic as you wish. Its only purpose in life is to get you started.

I am sure you can do a better job at it and am looking forward to your contribution.

Jos :mellow:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  
Followers 0