This is based on an EventScripts handler I wrote which will automatically migrate tabs from safari to Chrome when the charger is plugged into the computer; and, vice versa. More information about how it works can be found here https://github.com/shazoom/eventscripts. The EventScripts version does a little more—it stops and starts Box Sync—but the main feature is the tab migration.
You will need to install defaultbrowser to use this workflow. Its easy to compile but you will need Xcode installed and can be found here https://github.com/kerma/defaultbrowser. You will need to edit the handler get_defaultbrowser_path in the script chrom_to_safari.scpt to point to the location where you have installed defaultbrowser.
This workflow is triggered by the bbt keyword. If Safari is the default browser, its tabs will be migrated to Chrome and if Chrome is default its tabs will be migrated to Safari. You can provide a parameter. This parameter should be either “chrome” or “safari” and it will migrate tabs to that browser.