Jump to content

Recommended Posts

Posted

Hi there,

 

I'm very new at scripting and I have a problem. I use these extremely simple lines to exhibit and print images from SAP. However I did not manage to find a solution to make it stop before the end, could someone help? Thanks in advance.

OBS: Since I'm using the company pc, I haven't the permission to install anything, I'm running the zip version of AutoIT.

 

For $i = 1 to 600 ; I print several images a day

WinActivate("Relatorio")
Sleep (300)
BlockInput (1) ; Block Use Input
Send("{ENTER}")
Sleep (1000)
Send("{F3}") ; This activates the hotkey from PrintKey 
Sleep (250)
MouseClickDrag ( "left" ,353 ,197 ,672 ,437 ,0 )
Sleep (400)
BlockInput (0) ; Unblock Use Input
WinActivate("Relatorio")
Send("{DOWN}")

Next

  • 1 month later...
Posted

Francesco, thanks for the response.

I have no idea where to insert this, before or after or between the For... Next loop. Could you give me an example?

Posted (edited)

It's not meant to break the script. It's meant to send your keys more reliably. Send() only works on the active window. It is better coding practice. 

HotKetSet() with a exit function will break the loop. 

HotKeySet("{ESC}", "Terminate")

Func Terminate()
    Exit 0
EndFunc

 

 

Edited by SkysLastChance

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...