Legacy1 Posted October 14, 2009 Share Posted October 14, 2009 Send a command to a program? Such as, for steam, -applaunch 240 or something? Or Pause iTunes? Link to comment Share on other sites More sharing options...
Legacy1 Posted October 14, 2009 Author Share Posted October 14, 2009 so like? Func Play() Send '-applaunch 240' 'Steam.exe' EndFunc maybe? Im new so that might be utter bull. Link to comment Share on other sites More sharing options...
Country73 Posted October 14, 2009 Share Posted October 14, 2009 You may want to look in the HelpFile for- WinExists - checks to see if a specific window exists WinActivate - Activates (gives focus to) a window ControlCommand - Sends command to a control This may get you going in the right direction. If you try to fail and succeed which have you done?AutoIt Forum Search Link to comment Share on other sites More sharing options...
Legacy1 Posted October 14, 2009 Author Share Posted October 14, 2009 uuugh, k ty. Link to comment Share on other sites More sharing options...
Country73 Posted October 14, 2009 Share Posted October 14, 2009 If you get stuck on something, just post what you have, and the problem. (What you expect it to do/What it's actually doing) Lot of people out here to help out. If you try to fail and succeed which have you done?AutoIt Forum Search Link to comment Share on other sites More sharing options...
Legacy1 Posted October 14, 2009 Author Share Posted October 14, 2009 (edited) HotKeySet("{F9}","CSS") ToolTip("F9 = CSS" ,600,0) WinExists ( "Friends - _.Legacy" [, ""] ) While 1 Func CSS() ControlCommand ("Friends - _.Legacy", "", ID, "-applaunch 240" [, ""] ) EndFunc WEnd Stuck? When I press F9 I want it to launch CSS. Edited October 14, 2009 by Legacy1 Link to comment Share on other sites More sharing options...
FuryCell Posted October 14, 2009 Share Posted October 14, 2009 This works on my system. HotKeySet("{F9}","CSS") ToolTip("F9 = CSS" ,600,0) While 1 Sleep(100) WEnd Func CSS() Run('"C:\Program Files (x86)\Steam\Steam.exe" -applaunch 240') EndFunc Try this one if you are not on x64 [AutoIt]HotKeySet("{F9}","CSS") ToolTip("F9 = CSS" ,600,0) While 1 Sleep(100) WEnd Func CSS() Run('"C:\Program Files\Steam\Steam.exe" -applaunch 240') EndFunc HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
Country73 Posted October 14, 2009 Share Posted October 14, 2009 (edited) Looking over what you have, this may be more towards what you are shooting for. I haven't tested any of this out, but hopefully gets you in the right direction. HotKeySet("{F9}","CSS") ToolTip("F9 = CSS" ,600,0) ;once script is launched, waiting for F9 to proceed While 1 Sleep(100) WEnd Func CSS() ;First you need to launch the application, Run or ShellExecute would be a good option ;Run("filename"[,"workingdir"[,show_flag[,opt_flag]]]) ;-runs an external program ;ShellExecute("filename"[,"parameters"[,"workingdir"[,"verb"[,showflag]]]]) ;-runs an external program using the ShellExecut API. ;pause execution of script until the requested window exists, give it a timeout WinWait("title"[,"text"[,timeout]]) ;Check to see if application launched, or timeout exceeded If WinExists("title"[,"text"]) Then ;Activate the window if it exists WinActivate("title"[,"text") Else MsgBox(262160,"ERROR","CSS did not launch",8) Exit EndIf EndFunc Edit: Looks like P5ych0Gigabyte was a little quicker on the reply Edited October 14, 2009 by Country73 If you try to fail and succeed which have you done?AutoIt Forum Search 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