Sign in to follow this  
Followers 0
jacksonm1234

Trying to switch from AHK to AutoIT

6 posts in this topic

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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

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  
Followers 0