Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to the Power Users community on Codidact!

Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.

Post History

60%
+1 −0
Q&A Find and close last opened tab in Safari

Warning: this will result in the entire window the tab was located in, to be deleted Warning: windows.plist is invalid without its data.data file. Back up both before proceeding. Skip the first t...

posted 8d ago by Andreas demands justice for humanity‭  ·  edited 8d ago by Andreas demands justice for humanity‭

Answer
#3: Post edited by user avatar Andreas demands justice for humanity‭ · 2025-05-23T13:19:45Z (8 days ago)
  • #### Warning: this will result in the entire window the tab was located in, to be deleted
  • #### Warning: `windows.plist` is invalid without its `data.data` file. Back up both before proceeding.
  • Skip the first two steps if you remember the name of the tab.
  • 1. Find and inspect `~/Library/Safari/History.db
`
  • A suitable application is DB4S, which can be installed with `brew install --cask db-browser-for-sqlite`
  • 2. Inspect `history_visits` and sort by `visit_time` to find the latest entry. Use `title` in the next step.
  • 3. Open `~/Library/Saved Application State/com.apple.Safari.savedState/windows.plist`
  • 4. Search for the page title from the previous state. It's the value for an `NSTitle` key. Once found, delete the enclosing dict.
  • 5. Start Safari. Every window except the one with the latest tab should now open. The window is likely lost because `data.data` now has a mismatch with entries for that window in `windows.plist`.
  • The window may be recoverable by using the application menu to choose to open the last closed window. I made too many mistakes in the process and lost this chance.
  • #### Warning: this will result in the entire window the tab was located in, to be deleted
  • #### Warning: `windows.plist` is invalid without its `data.data` file. Back up both before proceeding.
  • Skip the first two steps if you remember the name of the tab.
  • 1. Find and inspect `~/Library/Safari/History.db
`
  • A suitable application is DB4S, which can be installed with `brew install --cask db-browser-for-sqlite`
  • 2. Inspect `history_visits` and sort by `visit_time` to find the latest entry. Use `title` in the next step.
  • 3. Open `~/Library/Saved Application State/com.apple.Safari.savedState/windows.plist`
  • 4. Search for the page title from the previous step. It's the value for an `NSTitle` key. Once found, delete the enclosing dict.
  • 5. Start Safari. Every window except the one with the latest tab should now open. The window is likely lost because `data.data` now has a mismatch with entries for that window in `windows.plist`.
  • The window may be recoverable by using the application menu to choose to open the last closed window. I made too many mistakes in the process and lost this chance.
#2: Post edited by user avatar Andreas demands justice for humanity‭ · 2025-05-23T05:03:43Z (8 days ago)
  • #### Warning: this will result in the entire window the tab was located in, to be deleted
  • #### Warning: `windows.plist` is invalid without its `data.data` file. Back up both before proceeding.
  • 1. Find and inspect `~/Library/Safari/History.db
`
  • A suitable application is DB4S, which can be installed with `brew install --cask db-browser-for-sqlite`
  • 2. Inspect `history_visits` and sort by `visit_time` to find the latest entry. Use `title` in the next step.
  • 3. Open `~/Library/Saved Application State/com.apple.Safari.savedState/windows.plist`
  • 4. Search for the page title from the previous state. It's the value for an `NSTitle` key. Once found, delete the enclosing dict.
  • 5. Start Safari. Every window except the one with the latest tab should now open. The window is likely lost because `data.data` now has a mismatch with entries for that window in `windows.plist`.
  • The window may be recoverable by using the application menu to choose to open the last closed window. I made too many mistakes in the process and lost this chance.
  • #### Warning: this will result in the entire window the tab was located in, to be deleted
  • #### Warning: `windows.plist` is invalid without its `data.data` file. Back up both before proceeding.
  • Skip the first two steps if you remember the name of the tab.
  • 1. Find and inspect `~/Library/Safari/History.db
`
  • A suitable application is DB4S, which can be installed with `brew install --cask db-browser-for-sqlite`
  • 2. Inspect `history_visits` and sort by `visit_time` to find the latest entry. Use `title` in the next step.
  • 3. Open `~/Library/Saved Application State/com.apple.Safari.savedState/windows.plist`
  • 4. Search for the page title from the previous state. It's the value for an `NSTitle` key. Once found, delete the enclosing dict.
  • 5. Start Safari. Every window except the one with the latest tab should now open. The window is likely lost because `data.data` now has a mismatch with entries for that window in `windows.plist`.
  • The window may be recoverable by using the application menu to choose to open the last closed window. I made too many mistakes in the process and lost this chance.
#1: Initial revision by user avatar Andreas demands justice for humanity‭ · 2025-05-23T05:02:15Z (8 days ago)
#### Warning: this will result in the entire window the tab was located in, to be deleted

#### Warning: `windows.plist` is invalid without its `data.data` file. Back up both before proceeding.

1. Find and inspect `~/Library/Safari/History.db
`

    A suitable application is DB4S, which can be installed with `brew install --cask db-browser-for-sqlite`

2. Inspect `history_visits` and sort by `visit_time` to find the latest entry. Use `title` in the next step.
3. Open `~/Library/Saved Application State/com.apple.Safari.savedState/windows.plist`
4. Search for the page title from the previous state. It's the value for an `NSTitle` key. Once found, delete the enclosing dict.
5. Start Safari. Every window except the one with the latest tab should now open. The window is likely lost because `data.data` now has a mismatch with entries for that window in `windows.plist`.

The window may be recoverable by using the application menu to choose to open the last closed window. I made too many mistakes in the process and lost this chance.