Jump to content

Is there anyway I can...


Legacy1
 Share

Recommended Posts

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 by Legacy1
Link to comment
Share on other sites

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

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 by Country73

If you try to fail and succeed which have you done?AutoIt Forum Search

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...