Jump to content
Sign in to follow this  
jojosgotmojo

Window close then power off

Recommended Posts

jojosgotmojo

Ok so i'm downloading something from the net and i want my pc to power off when its finished so i was wondering will this do or will it need more

If WinClose ( "Downloads" )
    then shutdown(9)
EndIf

If WinActive ( "Downloads" )
    then sleep( 10000 )
EndIf

Share this post


Link to post
Share on other sites
Andreik

Ok so i'm downloading something from the net and i want my pc to power off when its finished so i was wondering will this do or will it need more

If WinClose ( "Downloads" )
    then shutdown(9)
EndIf

If WinActive ( "Downloads" )
    then sleep( 10000 )
EndIf
If Not WinExists() Then

Shutdown(8+1)

EndIf


When the words fail... music speaks

Share this post


Link to post
Share on other sites
jojosgotmojo

If Not WinExists() Then

Shutdown(8+1)

EndIf

Will that shutdown pc and turn off once download is finished?

Share this post


Link to post
Share on other sites
Andreik

Will that shutdown pc and turn off once download is finished?

Put them in a while loop and set parameters for WinExists.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
jojosgotmojo

Put them in a while loop and set parameters for WinExists.

Yeah prolly should note: IM A VB NOOB!

Share this post


Link to post
Share on other sites
jojosgotmojo

Visual Basic, isnt that what the main scripting auto it uses?

Share this post


Link to post
Share on other sites
Andreik

I use Firefox and this is the window that appear when I download something.

When this window doesn't exist then download process is finished.

You can check with WinExists if that window exists or not.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
jojosgotmojo

im confused can u pls just speak like ur speaking to an asian man, slowly and with simple words. Well im using safari atm and the window is called downloads

any better?

Share this post


Link to post
Share on other sites
bluelamp

Visual Basic, isnt that what the main scripting auto it uses?

If I understand your question correctly you mean that AutoIt is written in VB?

It is written in C++, but the Syntax from AutoIt is like VB.

Use the Code from Andreik:

While 1
If Not WinExists("downloads") Then
Shutdown(8+1)
EndIf
Wend
Edited by bluelamp

Share this post


Link to post
Share on other sites
Andreik

ok so thats all i need? just making sure

If you cannot understand me (I`m not a very english speaker), you can look in the help file to give you some details about doing things.


When the words fail... music speaks

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.