Jump to content

A few newbie questions


beboard
 Share

Recommended Posts

Hi everybody,

I'm just learning to use AutoIT and I have some questions I can't seem to find the answer for

I was wondering if it would be possible to assign some shortcuts keys to some macros... something like

CTRL+SHIFT+H
mouseclick ... 
mouseclick ... 
send ...
mouseclick ..


CTRL+SHIFT+I
mouseclick ... 
send ...

I need this to run as an application and basically i just want it to send some mouseclicks depending on the shortcuts keys.

Also is there some way to make the script take different actions depending on the active window ?

I'm trying to make a script that will work with an excel macro and basically the excel macro should display a message box with different titles. Can I make the autoIT script read the title of this message box and take appropriate action ?

Thank you in advance for your replies, any help will be much appreciated.

Link to comment
Share on other sites

You can use HotKeySet to create hot keys (to run a function). You can check if a window or messagebox is open using WinExists. You can get information such as window title/text using AutoIt Window Info tool (found in the start menu). You can read text from a window using WinGetText. I suggest you start by trying a simple project to learn how to use each of these functions and the AutoIt Window Info tool. There are also some Excel UDFs that could be useful, but I don't know much about them.

Link to comment
Share on other sites

You can use HotKeySet to create hot keys (to run a function). You can check if a window or messagebox is open using WinExists. You can get information such as window title/text using AutoIt Window Info tool (found in the start menu). You can read text from a window using WinGetText. I suggest you start by trying a simple project to learn how to use each of these functions and the AutoIt Window Info tool. There are also some Excel UDFs that could be useful, but I don't know much about them.

Could you please give me an example on how to assign a hotkey to a series of mouse clicks ? It would solve most of my problems ;) thanks for the reply

While 1
    MouseClick("left", 384, 544, 1)
    MouseClick("left", 338, 663, 1)
    Send("install")
    MouseClick("left", 481, 552, 1)
    MouseMove(550, 592)
    MouseDown("left")
    MouseMove(576, 595)
    MouseUp("left")
    MouseClick("left", 618, 545, 1)
    MouseMove(553, 615)
WEnd

How do I make my script do this when I press Alt+Ctrl+s ? I have more codes like this and I want to assign to each of them a hotkey.

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