Jump to content

Recommended Posts

Posted (edited)

it opens everything twice still cept yahoo messenger and it only closes 1 of everything else when there is two of them open and it still isnt touching yahoo messenger its as if yahoo isnt even there

Use the code in ChrisL or my reply instead of yours and it will work. Compare yours to it and you will see your error.

Edit - too slow again

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

  • Moderators
Posted (edited)

Create a test script by itself without trying to put it in your own code. The codes work, it's probably just your implementation. After creating a 'Blank' Test.au3 script insert this code:

HotKeySet("!{F9}", "Close");alt + F9 to close

Dim $Explorer = Run(@ProgramFilesDir & '\Internet Explorer\IEXPLORE.EXE')
Dim $Calc = Run('calc.exe')
Dim $NotePad = Run('Notepad.exe')
Dim $Yahoo = Run(@ProgramFilesDir & '\Yahoo!\Messenger\YPager.exe')
$IamAnArse = 1

While $IAmAnArse
Sleep (1000)
Wend

Func Close()
    If ProcessExists($Explorer) Then ProcessClose ($Explorer)
    If ProcessExists($Calc) Then ProcessClose ($Calc)
    If ProcessExists($NotePad) Then ProcessClose ($NotePad)
    If ProcessExists($Yahoo) Then ProcessClose ($Yahoo)
    $IamAnArse = 0
EndFunc

Notice this code does not require 'Beta', but just to keep things simple:

Run the code using Alt+F5 (holding both the Alt down while you press F5)

Then as the windows are all open, use the Alt+F9 (again holding down Alt while you press F9).

Also, make sure the paths are correct for you for your yahoo and internet explorer.

If it still doesn't work, Close SciTe, Close AutoIt, and enjoy your family/friends for the rest of the day.

P.S. What OS are you using, just for curiousity sakes?

Edit: I noticed that there was an un-needed set of quotes in the Run() yahoo.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
×
×
  • Create New...