Jump to content

Hotstrings/Auto-completion/Abbreviations: expand text while you type


Recommended Posts

Is there a simple way to write a script that expands abbreviations when I type them?

I'm new to AutoIt, so please excuse me if it's a redundant topic; I couldn't find anything in the forums though.

I would like to write a script with hotstring script activation similar to RoboType, AutoHotkey, Macro Express etc. (those programs are good alternatives but since AutoIt "feels" superior to all of those, I thought it would be worth asking).

- When I type e.g. "btw" in any program, I want AutoIt to start a function that replaces "btw" with "by the way".

- Or when I type "//date", I want to replace it with the current date and time.

- Or when I type "//next", I want to replace it with one of my programming code snippets.

- Or when I type "//dlg", I want to replace it with a snippet and automatically perform some other complex actions.

I tried to use HotKeySet("btw", "ExpandBTW") but that function obviously isn't meant to work like that.

I don't want to use a hotkey combination before or after I typed an abbreviation, I just want AutoIt to automatically detect it whenever I type one. It would be nice to specify wether AutoIt should detect an ending character (e.g. space, comma, enter), case sensitivity, etc.

Thanks!

Link to comment
Share on other sites

The quick answer, yes. To do it as you say is essentially a key logger. That is discouraged and you'll find no help in this forum.

However the better way to do it could be to select the text after typing then search it for your key phrases and replace from whatever list you have prepared.

Alternatively you could create custom hotkeys ie: ctrl+shift+b types 'by the way'.

Hope it helps.

Link to comment
Share on other sites

The quick answer, yes. To do it as you say is essentially a key logger. That is discouraged and you'll find no help in this forum.

However the better way to do it could be to select the text after typing then search it for your key phrases and replace from whatever list you have prepared.

Alternatively you could create custom hotkeys ie: ctrl+shift+b types 'by the way'.

Hope it helps.

Thanks for your reply - that's indeed a quick and clear answer, and all I need to know for now. :D
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...