AppleScript – Move Tab in Google Chrome Using AppleScript

applescriptgoogle-chrometabs

Is there a way to move tab using the tab number in Google Chrome ?

something like this :

tell application "Google Chrome"
    set activeIndex to get active tab index of window 1
    tell window 1
        set TheTab to move tab 3 after third tab 
    end tell
    set active tab index of window 1 to activeIndex
end tell

obviously the code is not valid

Best Answer

I do not believe this is possible using the Chromium suite.

  • Window provides the property ‘active tab index’ as get/set, however setting this only changes which tab the window has active, rather than setting the index of the tab itself (i.e. it changes the active tab to an entirely different tab).
  • One can get the ‘active tab’ from the window, but tab itself does not provide any relevant commands.
  • A new tab without focusing can only be created at the end of the list of tabs of a particular window.