On Shortcut

  1. ⌥7 is pressed.

Check Conditions

AND
  1. The frontmost application is Finder

Keep Current Finder Window

  1. Run AppleScript using -- Keep Finder's front window; cl... with , timeout 120 seconds, and stop this flow if unsuccessful

Keep the folder you are working in

When: Press Option + 7. If: Finder is frontmost. Do: Run AppleScript to capture the Finder windows behind its front window, then close those other windows.

This is useful after browsing many folders: keep the current working location and clear the clutter. It differs from Option-Command-W, which closes the current window along with the others.

Configure and try it

  1. Open three ordinary Finder windows in disposable folders.
  2. Bring the one you want to keep to the front.
  3. Import the Rule, review Option + 7 and allow Finder Automation.
  4. Enable it and press the shortcut with Finder still frontmost.
  5. Confirm that the front window remains and the other windows close. Try again with one window; nothing else should close.

Requirements and limits

Run AppleScript does not require Pro. The Rule needs Finder Automation access. Rulr’s native All Windows target cannot express “all except the front window,” which is why this adapted workflow uses a small Finder script.

The script targets Finder’s window order, including windows reported on other Spaces. It closes tabs contained in the other windows but keeps the retained window’s tabs. It does not delete files, quit Finder or restore closed browsing state.

For a named folder from the current selection, use Group Selected Files.