File tree Expand file tree Collapse file tree 3 files changed +14
-17
lines changed Expand file tree Collapse file tree 3 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 58
58
SCRIPT_DIR=$( dirname " $( realpath " $0 " ) " )
59
59
60
60
# Get urls of open Safari tabs via AppleScript.
61
- bin=" $SCRIPT_DIR /helpers/get_safari_urls.scpt"
62
- if [ ! -e " $bin " ]; then
63
- osacompile -o " $bin " " $SCRIPT_DIR /helpers/get_safari_urls.applescript"
64
- fi
65
- urls=$( osascript " $bin " )
61
+ urls=$( osascript << 'EOA '
62
+ tell application "Safari"
63
+ set windowList to every window
64
+ set urlList to {}
65
+ repeat with aWindow in windowList
66
+ set tabList to every tab in aWindow
67
+ repeat with aTab in tabList
68
+ set end of urlList to URL of aTab
69
+ end repeat
70
+ end repeat
71
+ return urlList
72
+ end tell
73
+ EOA
74
+ )
66
75
IFS=' , ' # Convert the output to a list
67
76
68
77
for url in $urls ; do
Original file line number Diff line number Diff line change 1
- get_safari_urls.scpt
2
1
gclone.cache
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments