Last active
October 19, 2024 19:57
-
-
Save amanuel/81e70673b057687e904a248218c50ce2 to your computer and use it in GitHub Desktop.
Revisions
-
amanuel revised this gist
Jan 26, 2020 . No changes.There are no files selected for viewing
-
amanuel created this gist
Jan 26, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ tell application "Firefox" activate set safariWindows to getSafariWindows() of me repeat with w in safariWindows set newTabURLs to takeSafariTabURLs(w) of me repeat with tabURL in newTabURLs open location tabURL delay 0.5 end repeat tell application "System Events" to keystroke "n" using command down delay 1 end repeat end tell on getSafariWindows() set safariWindows to {} tell application "Safari" repeat with w in windows if name of w is not "" then --in case of zombie windows set the end of safariWindows to w end if end repeat return safariWindows end tell end getSafariWindows on takeSafariTabURLs(w) set tabURLs to {} tell application "Safari" repeat with t in tabs of w set tabURL to URL of t set the end of tabURLs to tabURL end repeat return tabURLs end tell end takeSafariTabURLs