Jump to content

Trying to switch from AHK to AutoIT


Recommended Posts

Hello all,

I am trying to explore AutoIT in the hopes of moving away from AutoHotKey (I hate AHK syntax!), but I have some questions.

In AutoIT, can I have hotkeys that are exclusive to certain programs? For example, I want to be able to have shift+space do something when one program is active, but do nothing in every other program. What would the code look like to do that?

Also, can AutoIT do string replaces (again, only in whatever programs I choose)? For example, in notepad, I'd like to be able to type "brb" and have it automatically be replaced by "be right back", but have "brb" mean nothing in every other program. How can I do that?

I'm not trying to start some comparison war here. If AutoIT can't do these things (but I'm sure it probably can), just tell me. Thanks in advance!

Link to comment
Share on other sites

Welcome to the forums.

The question "What would the code look like to do that?" is equal to "make this code for me" which folk arnt best fond of around here.

I can say that both situations you are after are doable with autoit3 and I can also say that if you put in a little effort you will get a lot of help.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Fair enough.

Would it be reasonable instead of having someone give me the code to at least talk me through it? I have done some searching on these forums and in the documentation, but am coming up blank. I understand how to set and "unset" hotkeys, but my main problem is I dont know how to get my script to sit there and wait for me to perform a certain action inside a certain program, and then go back to waiting. I'd like to have multiple hotkeys for multiple programs inside one script, kinda like I do today with AHK.

Link to comment
Share on other sites

You would probably use either of these two functions, WinExists, or, ProcessExists; and a conditional statement, such as this, If.... Of course, this function would certainly be used also - HotKeySet.

Welcome to the Forum, Good Luck!

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

  • Moderators

jacksonm1234,

Welcome to the AutoIt forum. :graduated:

can I have hotkeys that are exclusive to certain programs?

Certainly. Look at GUISetAccelerators in the Help file.

can AutoIT do string replaces?

You can do this by using the HotStrings UDF. I am not sure if this is automatically limited to a single app, but you can easily make it so programatically by checking if the app GUI is active.

I hope this helps. :(

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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