Jump to content
Sign in to follow this  
Legacy1

Is there anyway I can...

Recommended Posts

Legacy1

Send a command to a program?

Such as, for steam, -applaunch 240 or something?

Or Pause iTunes?

Share this post


Link to post
Share on other sites
Legacy1

so like?

Func Play()

Send '-applaunch 240' 'Steam.exe'

EndFunc

maybe?

Im new so that might be utter bull.

Share this post


Link to post
Share on other sites
Country73

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

Share this post


Link to post
Share on other sites
Country73

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

Share this post


Link to post
Share on other sites
Legacy1

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

Share this post


Link to post
Share on other sites
FuryCell

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.

Share this post


Link to post
Share on other sites
Country73

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

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.