Jump to content

Recommended Posts

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
  • Moderators
Posted

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

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted
  On 1/19/2017 at 10:50 PM, 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

 

Expand  

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.

 

  On 1/19/2017 at 11:55 PM, zone97 said:

 

Expand  
  On 1/19/2017 at 11:55 PM, 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

 

Expand  

 

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.

Posted

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

 

  Reveal hidden contents

 

Posted
  On 1/20/2017 at 3:24 PM, zone97 said:

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

Expand  

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...