JuanLopez

Send Multiple Commands with A single HotKeySet if Window IS Active

6 posts in this topic

#1 ·  Posted (edited)

Okay ive been googling and looking through here site:autoitscript.com and I cant find the answers not sure if im just not using the right keywords or what (im new to autoit).

 

What I am trying to do is set a HotkeySet and when that key is pressed to send 3 separate commands, First (ctrl+alt+shift+e) / 2nd, THEN send Mouseclick(181, 305, 1)/  3rd, THEN send('2') /

So with a single key would like it to function 3 separate commands/scripts.
 

teh script i have works for the first command, I just dont know how to append the 2nd and 3rd to it.

 

#include <AutoItConstants.au3>

HotKeySet("{ESC}", "AltF5")

Func AltF5()
    If WinActive('Program X')   Then Send('^!+e') MouseClick($MOUSE_CLICK_LEFT, 181, 305, 1) Send('2')
    EndFunc

 

Edited by JuanLopez

Share this post


Link to post
Share on other sites



Look at the example for If...Then in the help file. You just need to perform the actions one after another:

If WinActive("My Program") Then
   ;Perform Step 1
   ;Perform Step 2
   ;Perform Step 3
EndIf

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
#include <AutoItConstants.au3>

HotKeySet("{ESC}", "AltF5")

Func AltF5()
    If WinActive('Program X') Then
        Send('^!+e')
        MouseClick($MOUSE_CLICK_LEFT, 181, 305, 1)
        Send('2')
    EndIf    
EndFunc

 


 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Share this post


Link to post
Share on other sites
1 hour ago, JLogan3o13 said:

Look at the example for If...Then in the help file. You just need to perform the actions one after another:

If WinActive("My Program") Then
   ;Perform Step 1
   ;Perform Step 2
   ;Perform Step 3
EndIf

 

Thanks I tried that and it didnt work cause i left out the Endif, but I have other if winactive hotkeysset that are without and they worked but they also arent double commands. So thanks.

 

 

46 minutes ago, zone97 said:
#include <AutoItConstants.au3>

HotKeySet("{ESC}", "AltF5")

Func AltF5()
    If WinActive('Program X') Then
        Send('^!+e')
        MouseClick($MOUSE_CLICK_LEFT, 181, 305, 1)
        Send('2')
    EndIf    
EndFunc

 

 

Thanks also, that worked my issue was I left out and if. Also do you know why the hotkeyset key I chose for instance is the letter "E" locks up meaning that I cant use it for anything else but that hotkeyset.

Share this post


Link to post
Share on other sites

I'm confused?  Are you meaning the hotkey you set? {ESC} or the hotkey your sending? "^!+e'"


 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Share this post


Link to post
Share on other sites
8 hours ago, zone97 said:

I'm confused?  Are you meaning the hotkey you set? {ESC} or the hotkey your sending? "^!+e'"

the question is answered already but I was asking how to make one hotkey {ESC} perform multiple  shortcuts back to back.

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