Jump to content

If specific windows close then script exit/stop


Recommended Posts

  • Developers

For example I want to make a script that opens notepad. Then do some actions (e.g. type some text) and wait (sleep) for the window (notepad) to close. If the window (notepad) close then the script exit.

... What have you tried ?

Look at :

Run()

Sleep()

WinWaitClose()

Exit

:whistle:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

... What have you tried ?

Look at :

Run()

Sleep()

WinWaitClose()

Exit

:whistle:

I will try to help you more:

_______________________________________________________________________________________

| say that the script is running

| (notepad is open)

| the script sends/types some text

| maybe accidentally i close notepad before the script exit

| after notepad close the script will continue sending keys

| i want the script to automatically stop/exit so it wont send keys anymore to another window

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Edited by Hello Me You
Random
Link to comment
Share on other sites

Hi,

then you need to check everytime you are going to send something If WinExists

Or use ControlSend

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

then you need to check everytime you are going to send something If WinExists

Or use ControlSend

So long,

Mega

1)why do u say all the time so long, mega?

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

2)i am gonna try if win exists, can u help me use it?

should i do this?:

If winexits
then send("text")
else
exit
Edited by Hello Me You
Random
Link to comment
Share on other sites

something like this:

While 1
    ; do something here
    If NOT WinExists("Untitled -") Then ; Checks if "Untitled-" doesn't exist anymore (you can change this to any title)
        Exit ; Closes script
    EndIf
WEnd
Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

  • Developers

I will try to help you more:

_______________________________________________________________________________________

| say that the script is running

| (notepad is open)

| the script sends/types some text

| maybe accidentally i close notepad before the script exit

| after notepad close the script will continue sending keys

| i want the script to automatically stop/exit so it wont send keys anymore to another window

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

You are going to help me more ? :whistle:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

For pausing a script, here's a function I got from the help file:

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

You are going to help me more ? :whistle:

Yeah, because you don't speak the language of stupidity to well. They are helping you ,because you cannot get your head around the fact that they don't know how to read the help file.... explain it once explain it twice and they still, question because of lazy attitude... :) have a good day.
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...