Overview
This prompt aims to guide users in creating an AutoHotkey script for paragraph deletion in documents. Programmers and coders will benefit by learning practical scripting techniques and enhancing their automation skills.
Prompt Overview
Purpose: This script automates the process of searching and deleting a specific paragraph in a document.
Audience: It is designed for programmers and users familiar with AutoHotkey scripting.
Distinctive Feature: The script includes user prompts and feedback for a seamless experience.
Outcome: Users can efficiently remove unwanted paragraphs from documents with minimal effort.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Data & Analysis, General Business Operations, Productivity & Workflow
- Techniques: Role/Persona Prompting, Self-Critique / Reflection, Structured Output
- 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 (AHK) script that searches for a specific paragraph in a document and deletes it. The script should:
1. Prompt the user to input the paragraph text they want to search for.
2. Open the target document (e.g., Word, Notepad).
3. Search for the specified paragraph within the document.
4. If the paragraph is found, delete it.
5. Provide appropriate feedback to the user regarding the success or failure of the operation.
### Steps:
– Use the `InputBox` function to get the paragraph from the user.
– Use `Send` commands to open the target application and paste the text.
– Employ `ControlFind` or similar functions to locate the paragraph.
– Use the `Send` command to simulate key presses for deleting the text.
### Output Format
The output should be a valid AHK script that includes the necessary functions and handles any potential errors.
### Example
Here is a sample user input and output:
– User Input: “This is the paragraph to delete.”
– AHK Script Output:
“`
InputBox, UserInput, Paragraph Search, Enter the paragraph text you wish to delete:
If UserInput
{
; Command to open the document goes here
; Command to search for UserInput and delete it goes here
}
“`
### Notes
– Ensure the script can handle cases where the paragraph may not be present in the document.
– Consider adding functionality to confirm the deletion with the user before proceeding.
– Include error handling to manage unexpected situations gracefully.
– Maintain clarity in user feedback messages throughout the script.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Open your preferred code editor for AHK scripts.
- Paste the copied prompt into the editor.
- Modify the script as needed for your specific document.
- Save the script with an .ahk file extension.
- Run the script to test its functionality.
Tips for Best Results
- Use InputBox: Prompt the user to enter the paragraph they want to delete.
- Open Document: Use `Run` command to open the target application like Notepad or Word.
- Search and Delete: Implement `ControlFind` to locate the paragraph and `Send` commands to delete it if found.
- Provide Feedback: Use message boxes to inform the user whether the deletion was successful or if the paragraph was not found.
FAQ
- What is AutoHotkey used for?
AutoHotkey is used for automating tasks in Windows, including keyboard shortcuts and scripting. - How do you prompt user input in AHK?
You can use the InputBox function to prompt the user for input in AHK. - What command opens a document in AHK?
You can use the Run command to open a document in applications like Word or Notepad. - How do you delete text in AHK?
You can simulate key presses using the Send command to delete text in AHK.
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.


