bojak71730 Posted January 22, 2006 Share Posted January 22, 2006 (edited) Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') Run('calc') Run('Notepad') Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') I made this script and what it does is it opens up internet explore calculator and notepad and yahoo messenger now what i wana figure out is how would i close all of these just by pushing a simple command on my keyboard cause i want all of these to close at once Edited January 22, 2006 by bojak71730 Link to comment Share on other sites More sharing options...
BigDod Posted January 22, 2006 Share Posted January 22, 2006 Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')Run('calc')Run('Notepad')Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')I made this script and what it does is it opens up internet explore calculator and notepad and yahoo messenger now what i wana figure out is how would i close all of these just by pushing a simple command on my keyboard cause i want all of these to close at onceLook at the example for ProcessClose in the help file and build it into your function for when the button is pressed. 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 Link to comment Share on other sites More sharing options...
ChrisL Posted January 22, 2006 Share Posted January 22, 2006 Try this HotKeySet("!{F9}", "Close");alt + F9 to close $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') $Calc = Run('calc') $NotePad = Run('Notepad') $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') Func Close() ProcessClose ($Explorer) ProcessClose ($Calc) ProcessClose ($NotePad) ProcessClose ($Yahoo) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ACalcutt Posted January 22, 2006 Share Posted January 22, 2006 (edited) i point you to the hotkey help that was right below this questionhttp://www.autoitscript.com/forum/index.php?showtopic=20617-edit - or the post above :-) Edited January 22, 2006 by ACalcutt Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 22, 2006 Moderators Share Posted January 22, 2006 (edited) HotKeySet("!{F9}", "Close");alt + F9 to close Dim $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') Dim $Calc = Run('calc.exe') Dim $NotePad = Run('Notepad.exe') Dim $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') 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) EndFunc @ChrisL Edited January 22, 2006 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. Link to comment Share on other sites More sharing options...
MHz Posted January 22, 2006 Share Posted January 22, 2006 @ChrisL & SmOke_N A loop sounds good to keep the script running for HotKeySet(). Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 22, 2006 Moderators Share Posted January 22, 2006 @ChrisL & SmOke_NA loop sounds good to keep the script running for HotKeySet(). Lmao!! No doubt... When I edited, I thought I put one in!! 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. Link to comment Share on other sites More sharing options...
BigDod Posted January 22, 2006 Share Posted January 22, 2006 Lmao!! No doubt... When I edited, I thought I put one in!!Daydreaming again. 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 Link to comment Share on other sites More sharing options...
bojak71730 Posted January 22, 2006 Author Share Posted January 22, 2006 well these codes dont work for me i had one code that open each program 3 times and when i went to use the hot key it closed only 2 of them instead of all of them Link to comment Share on other sites More sharing options...
ChrisL Posted January 22, 2006 Share Posted January 22, 2006 (edited) Loooooop Oh yeah.. forgot about that part! expandcollapse popup HotKeySet("!{F9}", "Close");alt + F9 to close $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') $Calc = Run('calc') $NotePad = Run('Notepad') $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') $IamAnArse = 1 While $IamAnArse Sleep (1000) Wend Func Close() ProcessClose ($Explorer) ProcessClose ($Calc) ProcessClose ($NotePad) ProcessClose ($Yahoo) $IAmAnArse = 0 EndFunc [\Code] Edited January 22, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options... bojak71730 Posted January 22, 2006 bojak71730 Members 16 Author Share Posted January 22, 2006 LoooooopOh yeah.. forgot about that part!can u rewrite the code cause i wana make this badboywork right Link to comment Share on other sites More sharing options... Moderators SmOke_N Posted January 22, 2006 SmOke_N Moderators 16.3k 49 It's not what you know ... It's what you can prove! Moderators Share Posted January 22, 2006 can u rewrite the code cause i wana make this badboywork right ... Err that's pretty basic AutoIt 101 , and you want HIM to re-write it? Have you tried yourself? 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. Link to comment Share on other sites More sharing options... ChrisL Posted January 22, 2006 ChrisL Active Members 1.8k Mass Spanner! Share Posted January 22, 2006 can u rewrite the code cause i wana make this badboywork rightSee above [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options... bojak71730 Posted January 22, 2006 bojak71730 Members 16 Author Share Posted January 22, 2006 it open everything twice cept yahoo messenger and the things it did open twice it only closed one of them and before i added this code it closed yahoo messenger and it dont even do that no more Link to comment Share on other sites More sharing options... BigDod Posted January 22, 2006 BigDod Jokers 7.3k RIP: The Mayor of Mirth Share Posted January 22, 2006 it open everything twice cept yahoo messenger and the things it did open twice it only closed one of them and before i added this code it closed yahoo messenger and it dont even do that no morePost your whole code so we can see if you did something wrong 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 Link to comment Share on other sites More sharing options... bojak71730 Posted January 22, 2006 bojak71730 Members 16 Author Share Posted January 22, 2006 Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') Run('calc') Run('Notepad') Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') HotKeySet("!{F9}", "Close");alt + F9 to close $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') $Calc = Run('calc') $NotePad = Run('Notepad') $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') $IamAnArse = 1 While $IamAnArse Sleep (1000) Wend Func Close() ProcessClose ($Explorer) ProcessClose ($Calc) ProcessClose ($NotePad) ProcessClose ($Yahoo) $IAmAnArse = 0 EndFunc Link to comment Share on other sites More sharing options... ChrisL Posted January 22, 2006 ChrisL Active Members 1.8k Mass Spanner! Share Posted January 22, 2006 Using Smoke_N's Dims and If's, I dont have yahoo but the rest work fine for me using this! HotKeySet("!{F9}", "Close");alt + F9 to close Dim $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') Dim $Calc = Run('calc.exe') Dim $NotePad = Run('Notepad.exe') Dim $Yahoo = Run('"C:\Program Files\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 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
BigDod Posted January 22, 2006 Share Posted January 22, 2006 Using Smoke_N's Dims and If's, I dont have yahoo but the rest work fine for me using this! HotKeySet("!{F9}", "Close");alt + F9 to close Dim $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') Dim $Calc = Run('calc.exe') Dim $NotePad = Run('Notepad.exe') Dim $Yahoo = Run('"C:\Program Files\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 EndFuncWorks for me to. 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 Link to comment Share on other sites More sharing options...
bojak71730 Posted January 22, 2006 Author Share Posted January 22, 2006 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 22, 2006 Moderators Share Posted January 22, 2006 It runs twice, because your telling it to run twice: you have:Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') Run('calc') Run('Notepad') Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') Then you have:$Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE') $Calc = Run('calc') $NotePad = Run('Notepad') $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"') $IamAnArse = 1 Just because there is a variable in front of the 2nd Run() sets, doesn't mean that it won't run them. Take out the first set of Run()'s 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now