Overview
This prompt aims to guide users in creating an AutoHotkey script with a functional GUI toggle button. Programmers and coders will benefit by learning how to implement GUI elements and automate key presses effectively.
Prompt Overview
Purpose: This script creates a GUI with a toggle button for automated key presses.
Audience: It is designed for programmers and users familiar with AutoHotkey.
Distinctive Feature: The toggle button changes color and text based on its state, enhancing user interaction.
Outcome: Users can automate key presses with a simple toggle, improving efficiency in repetitive tasks.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Content & Media Creation, Data & Analysis, Development Tools & DevOps
- Techniques: Zero-Shot Prompting
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Create an AutoHotkey script featuring a graphical user interface (GUI) with a toggle button. The toggle button must change its appearance and behavior as follows:
– When the toggle button is activated:
– Change its text to “Active”.
– Change its color to green.
– Wait for 3 seconds.
– Simulate pressing the keys: Space, then period (“.”), then “5”.
– Then, every 5 minutes, simulate pressing the Space key.
– When the toggle button is deactivated:
– Change its text to “Deactive”.
– Change its color to red.
– Stop all automated key presses immediately.
The script should continuously perform these actions based on the toggle state and must handle starting and stopping smoothly without requiring a restart.
# Steps
1. Create an AutoHotkey GUI window with a toggle button.
2. Define the toggle button’s activation and deactivation behavior, changing text and color accordingly.
3. On activation:
– Start a timer or loop that first waits 3 seconds.
– Send Space, “.”, and “5” key presses.
4. After the initial sequence, set a timer to send a Space key every 5 minutes.
5. On deactivation:
– Stop the timer.
– Reset the button text and color.
# Output Format
Provide the complete AutoHotkey script code that implements the above functionality.
# Example
“`autohotkey
; [Your AutoHotkey script implementing the described GUI toggle button and behavior]
“`
# Notes
– Use standard AutoHotkey commands and syntax.
– Ensure the GUI is responsive, and the toggle button accurately reflects the current state at all times.
– Handle possible rapid toggling without errors or unexpected behavior.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Open your preferred text editor or IDE.
- Paste the copied prompt into the editor.
- Run the prompt to generate the AutoHotkey script.
- Test the generated script in AutoHotkey.
- Adjust any parameters as needed for your use case.
Tips for Best Results
- “`autohotkey
- Gui, Add, Text, , Toggle Automation
- Gui, Add, Button, vToggleButton gToggle, Deactive
- Gui, Show, , AutoHotkey Toggle Script
- return
- Toggle:
- ToggleButtonState := !ToggleButtonState
- if (ToggleButtonState) {
- GuiControl,, ToggleButton, Active
- GuiControl, +BackgroundGreen
- Sleep, 3000
- Send, {Space}
- Send,
- Send, 5
- SetTimer, SendSpace, 300000
- 5 minutes
- } else {
- GuiControl,, ToggleButton, Deactive
- GuiControl, +BackgroundRed
- SetTimer, SendSpace, Off
- }
- return
- SendSpace:
- Send, {Space}
- return
- GuiClose:
- ExitApp
- “`
FAQ
- What is AutoHotkey used for?
AutoHotkey is a scripting language for automating the Windows GUI and general scripting. - How do you create a GUI in AutoHotkey?
You use the Gui command followed by options to define the window and controls. - What does a toggle button do in a script?
A toggle button allows users to switch between two states, activating or deactivating functionality. - How can you simulate key presses in AutoHotkey?
You can use the Send command followed by the keys you want to simulate.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


