Réponses:
Vous pouvez utiliser ce AppleScript; il crée un script shell contenant les liens de tous les onglets de la fenêtre Safari actuelle:
-- Set the default folder to Home -> bookmarks
set bookmarkFolder to "/bookmarks"
set username to do shell script "whoami"
set defaultFolder to POSIX file ("/Users/" & username & bookmarkFolder)
-- Initialize the text ot the script.
set cmd to "#!/bin/bash" & linefeed & linefeed
-- Add commands to open all the tabs.
tell application "Safari"
set n to count of tabs in front window
repeat with i from 1 to n
set cmd to cmd & "open -g " & URL of tab i of front window & linefeed
end repeat
end tell
-- Open/create a file and save the script.
tell me
activate
set scriptAlias to choose file name default name "tabset" default location (defaultFolder as alias)
end tell
set scriptPath to quoted form of POSIX path of scriptAlias
set scriptFile to open for access scriptAlias with write permission
set eof scriptFile to 0
write cmd to scriptFile starting at eof
close access scriptFile
-- Change the file attributes to make it double-clickable.
do shell script "chmod 777 " & scriptPath
do shell script "xattr -wx com.apple.FinderInfo '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' " & scriptPath
La version originale est par le Dr Drang .
J'ai changé deux choses:
~/bookmarks
Pour l’exécuter, vous pouvez soit utiliser un lanceur (comme Quicksilver
ou Butler
) ou envelopper dans un System Service
avec Automator
:
Run Applescript
article Service receives
pas d'entrée in
Safari System Preferences > Keyboard > Shortcuts > Services
⌘⌥D
ne fonctionne pas si vous l'utilisez pour basculer la visibilité du Dock