Can Mac do this? Rotate each Chrome tab every 5 seconds

while(1 -eq 1){
$wshell=New-Object -ComObject wscript.shell;
$wshell.AppActivate('Google Chrome');
Sleep 5;
$wshell.SendKeys('^{PGDN}');
}

in Power Shell.