sensible-hq / sensible-docs

powers https://docs.sensible.so/
1 stars 0 forks source link

author macro once in mintlify #277

Open fscelliott opened 1 week ago

fscelliott commented 1 week ago

I want to be able to enter the text "hello1" followed by pressing the tab key in any text editor in windows 10, and have it expand to . how do i do so with autohotkeys or with another windows 10 universal macro program? ChatGPT You can achieve this using AutoHotkey, a powerful and free scripting language for Windows that allows you to create custom keyboard shortcuts and macros.

Here's how you can set up a script that expands "hello1" followed by pressing the Tab key to in any text editor:

Download and install AutoHotkey:

Visit the AutoHotkey website and download the installer. Run the installer and follow the instructions to install AutoHotkey on your computer. Create a new AutoHotkey script:

Right-click on your desktop or in any folder, select New > AutoHotkey Script. Name your script (e.g., ExpandHello.ahk). Edit the script:

Right-click on the new script file and select Edit Script.

Delete any content in the file and add the following script:

autohotkey Copy code ; Define a hotstring that triggers when "hello1" is typed followed by the Tab key ::hello1:: SendInput, return Save and run the script:

Save the changes to the script file and close the editor. Double-click the script file to run it. An AutoHotkey icon should appear in your system tray indicating that the script is active. With this script running, typing "hello1" followed by pressing the Tab key will be automatically replaced with in any text editor or text input field.

Explanation of the Script: ::hello1::: This defines a hotstring that matches "hello1". SendInput, : This sends the text to the active window. return: Ends the hotstring definition. Additional Notes: You can customize the hotstring and the replacement text by modifying the script. If you want the hotstring to trigger only when followed by specific keys (e.g., Tab), you can adjust the script to account for that. However, AutoHotkey's default behavior for hotstrings does not require the Tab key unless explicitly scripted to do so. If you encounter any issues or need further customization, feel free to ask!

fscelliott commented 1 week ago

keys should be like /color and /method !