yuanzhoucq / Tab-Space

A Safari extension born for improving your web browsing productivity.
https://mytab.space
101 stars 14 forks source link

[FEATURE] Shortcut + L/R to move the tabs on the L/RHS to a new safari window #39

Open realliyifei opened 4 years ago

realliyifei commented 4 years ago

I love to open a new safari window for every new main searching topic, for instance, safari window A (9 tabs) for topic A, safari window B (17 tabs) for topic B.

However, sometimes I don't realize that the searching topic is big enough to open a new safari window until I already opened several tabs for it. In this case, I have to move these tabs one-by-one to a new window and it's inconvenient and time-consuming.

It would be helpful if we can have new shortcut + L/R to move the tabs on the left/right-hand side to a new safari window and then close them.

(while currently ctrl+L/R closes them directly)

gingerbeardman commented 4 years ago

FWIW, I do this using Alfred, running the following script on a hotkey:

on alfred_script(q)

tell application "Safari"
    set original_window to front window
    set tab_index to index of current tab of original_window

    make new document
    move tabs tab_index thru -1 of original_window to front window
    close first tab of front window
end tell

end alfred_script
Screen shot 2020-09-18 at 11 42 47
realliyifei commented 3 years ago

@gingerbeardman Thanks for your suggestion. Now I set

moving the tabs on RHS by

move tabs tab_index thru -1 of original_window to front window

moving the tabs on LHS by

move tabs tab_index thru 0 of original_window to front window

But now they contain the current tab as well. How can I move the tabs on RHS except for the current one? (works like this safari extension)

gingerbeardman commented 3 years ago

When I do this I want them to contain the current tab.

But tab_index is the current tab so try tab_index+1? I haven't tested this.

realliyifei commented 3 years ago

Thanks, it works. I put it on github! It should be

moving the tabs on RHS by

move tabs (tab_index - 1) thru -1 of original_window to front window

moving the tabs on LHS by

move tabs (tab_index + 1) thru 0 of original_window to front window