Dec 20, '06 07:30:00AM • Contributed by: anoved
If you need a bit more detail on the script, you can read about it here. This is somewhat similar to this hint, but much simpler.
|
|
|
Open current Safari tab in a new window via AppleScript
Dec 20, '06 07:30:00AM • Contributed by: anoved
Sometimes when I have many pages loaded as tabs in one Safari window, I would like to look at two of those pages at once. So I wrote an AppleScript called Load Tab in New Window (view source, download compiled script) that re-opens the frontmost tab in a new window and closes the original tab, effectively popping the page out into its own window. It's not perfect, but I find it handy.
If you need a bit more detail on the script, you can read about it here. This is somewhat similar to this hint, but much simpler.
•
[14,136 views]
Hint Options
Open current Safari tab in a new window via AppleScript
I know that scripting is all the rage, but why not do this the old-fashioned way?
keystroke efficiency
Well, a script can be invoked with a single keystroke, also using one of the many tools you mention. For instance, I don't actually go to the scripts menu to run this; I use FastScripts to run it with There is usually more than one way to do something: in addition to the sequence you point out, you could press As with many hints, I'm simply offering an alternate way to do something that is already quite possible.
keystroke efficiency
Command-L, Command-shift-option-return opens the current tab in a new window. Two Command-W's and both are closed...
Open current Safari tab in a new window via AppleScript
Could a similar script be written that does the complete opposite? It would take all open Safari windows and tabs and re-open them as tabs within a single window. Useful for those sites that demand to open things in new windows instead of tabs, and without having to run some sort of hack or Safari enhancement.
combining windows and tabs
I think so. Apple provides an example script called Combine Windows here that almost does it, except it only takes the frontmost tab from each open window. To retain all the tabs of each window you'd probably have to resort to more UI scripting, but I think it could be done. I agree that would be a worthwhile script.
Open current Safari tab in a new window via AppleScript
Combining all open windows in Safari is easy. Its in Window > Merge All Windows
Open current Safari tab in a new window via AppleScript
If you set Preferences… > General > New window opens with: to Same Page, all you have to do is hit Cmd-N.
closing previous tab
That's a good point and a pretty good tip. I forget about that option. Ideally it would be possible to close the previous tab by holding down option or something when pressing Command-N, as the main effect I was shooting for here was to "pop" a page out of its tab into a window, without leaving the original copy behind. Still, this is good. Thanks.
Open current Safari tab in a new window via AppleScript
I do like the old fashioned way, for sure, but neither addresses what I think should be the main goal in this: popping a tab to a window w/o interrupting the 'session.' For example, if while writing this comment, I use either your script or press command-l, command-option-return; it interrupts the session. As far as I can see, the only way of doing it is to just close all the tabs - or repop them on another window (as tabs) by whatever means. There must be a way of popping a tab into a window while retaining the logins, etc, etc. Ok, I'll admit, I'm playing a flash game and I realize it's so slow (and doesn't do anything unless it's the top tab - tab, not window) that I need it to be it's own window.
I concur but don't know how to do it
...should be the main goal in this: popping a tab to a window w/o interrupting the 'session.' For example, if while writing this comment, I use either your script or press command-l, command-option-return; it interrupts the session... Absolutely. As I noted in the script, 'ideally the page would just be "moved" to a new window without reloading it,' which I think is getting after the same thing. There are many cases where it'd be nice to move something like an email or comment in progress or a video that's being played to a new window, but obviously my script isn't much help in such cases as the page is actually just closed and reloaded. If I knew a better way to handle page content in AppleScript I'd definitely use it.
Open current Safari tab in a new window via AppleScript
For a moment I thought this was about CLONING the existing tab to a new window, to get two instances. But as you're closing the original tab: why not do it the Safari way? ;-)
Simply drag the tab away from the tab bar let go. This will disconnect the tab as a standalone window, and will give you a nice effect as well. Or: menu Window, Move Tab to New Window? (If you'd like a split screen within the very same tab, then these bookmarklets might help you: http://pimpmysafari.com/bookmarklets/ but I doubt that is what you want)
Open current Safari tab in a new window via AppleScript
Oh, I now see this was quite an old hint. Anyway, the latest Safaris support this feature; don't know about the 2006 versions :-)
Open current Safari tab in a new window via AppleScript
I imagine that the solution was needed in times of Safari 2 and, palahala, you are right that now in Safari 3 you can just drag & drop.
Open current Safari tab in a new window via AppleScript
Now that it's built in, I wonder if anyone has written a script to take the next logical step: The ability to (with one command) take all of the tabs in the current window (at once) and split them all out to their own windows? If not, I wonder how hard it would be to code that. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.23 seconds |
|