Last active
January 5, 2024 19:14
-
-
Save dmitriykovalev/3f155fbb48dc3e403d0e591d75f8b72b to your computer and use it in GitHub Desktop.
Save all chrome tabs to json file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| osascript -l JavaScript > $(date '+%Y.%m.%d-%H.%M.%S')-chrome-tabs.json <<EOF | |
| var app = Application('Google Chrome'); | |
| let result = app.windows().map((w) => { | |
| return { | |
| 'name': w.name(), | |
| 'tabs': w.tabs().map((t) => { | |
| return {'title': t.title(), 'url': t.url()}; | |
| }), | |
| }; | |
| }); | |
| JSON.stringify(result, null, 2); | |
| EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment