🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

Safari Split Window

Published 2013-04-08 @ 12:00

Tagged productivity, osx

Save this in ~/Library/Scripts/Applications/Safari/ and name it something like “Split Window at Tab”. It isn’t perfect, as it seems to reopen the url instead of just moving the tab. That might interrupt any transient data in your current session. But it is good enough for me to fire up a bunch of urls and then put them into their own window in one fell swoop.

tell application "Safari"
  set n to index of current tab of window 1
  set m to count of tabs of window 1
  
  make new document
  
  repeat with i from n to m
    move tab n of window 2 to window 1
  end repeat
  
  delete tab 1 of window 1
end tell