Backup data from major macOS Applications.
Sometimes application state can be broken, so we need a way to restore it, especially when macOS cannot do it (after update).
git clone https://github.com/ego/MacOps.git
Partial backups
cd MacOps/
./Backup.sh
Note: Sublime tabs should be run manually
Sublime-save-tabs.py
Backup location user HOME
directory with nested structure by apps
~/Workspaces/Homebrew/$(date '+%Y-%m-%d-%H')
~/Workspaces/iTerm2/Tabs/$(date '+%Y-%m-%d-%H').txt
# and so on ..
Full copy of Applications folders
./Backup-applications.sh
- Homebrew save Brewfile and brew --list commands
./Homebrew-save-brewfile.sh
- iTerm2 save open current Tabs
./iTerm2-save-tabs.sh
- Safari save open current Tabs
./Safari-save-tabs.sh
- Finder save open current Tabs
./Finder-save-tabs.sh
- Sublime save files history
./Sublime-save-files-history.sh
- Sublime save open current Tabs
Open Sublime and go to View/Show Console
and paste content from
Sublime-save-tabs.py
See README
See README
- Compare
Bookmarks.plist
withHistory.db
:
add_bookmarks_to_history.py
plus Query.sql
- Save last session plist to csv file
last_session_plist_to_csv
- Save Safari history to HTML files
TODO: save_history_to_html.py
AppleScript and JavaScript for Automation (JXA). Python and Bash for scripting.
open osascript/Debug.scpt
Print logs or alert pop-ups:
console.log("") and app.displayDialog("")
var app = Application.currentApplication()
app.includeStandardAdditions = true
var array = ["Sal", "Ben", "David", "Chris"]
var arrayLength = array.length
for (var i = 0; i < arrayLength; i++) {
var currentArrayItem = array[i]
// Process the current array item
app.displayDialog(`${currentArrayItem} is item ${i + 1} in the array.`)
}
Mac Automation Scripting Guide
Closing lots of Safari tabs with JXA
Apple JavaScript for Automation
Introduction to AppleScript Language Guide
PyXA appscript py-appscript pyobjc
Profiles - Where Firefox stores your bookmarks, passwords and other user data