Automatically close a window in RunMacro
Desktop ModeRunMacro 3.5+
The Close Window command finds a window by its title and sends a close request (like clicking the X).
Dialog & quick setup

- Add a Window › Close Window command.
- Pick the target window from the list (or type the title, use
*for partial matches). - Save. On run, RunMacro sends a close request to that window.
Options reference
Modes & when to use
Desktop Mode
Best for
- Close a pop-up ad/notification window.
- Shut an app after finishing.
- Clear an old window before opening a new one.
Use an alternative when
- Do not use it while the window has unsaved data or requires a separate confirmation flow.
Before you run
- Add Close Window to the macro.
- Prepare the data or target that Close Window will use.
Example workflow
Example: close a Notepad window
- Add Close Window.
- Choose the window whose title contains "Notepad".
- Save and run — the Notepad window closes.
Expected result: After execution, Close Window completes the described action and makes its result available to the next step.
Tips & limitations
Use
* when the title varies, e.g. *Notepad to match any open file.If the app asks to save on close, add a dialog-handling step (Click/Key) after this command.
- The application can block the close request, show a confirmation dialog, or fail to match the target title.
Applies to RunMacro 3.5+ · Desktop Mode · Windows 10/11
