Update switch-tabs.ps1

This commit is contained in:
Markus Fleschutz 2023-03-30 11:36:38 +02:00
parent 762c7a0dd2
commit f49d4f659d

View File

@ -3,6 +3,8 @@
Switches browser tabs
.DESCRIPTION
This PowerShell script switches browser tabs automatically every <n> seconds (by pressing Ctrl + PageDown).
.PARAMETER Interval
Specifies the switch interval in seconds (10 sec per default)
.EXAMPLE
PS> ./switch-tabs
.NOTES
@ -11,13 +13,13 @@
https://github.com/fleschutz/talk2windows
#>
param([int]$Interval = 5) # in seconds
param([int]$Interval = 10) # in seconds
try {
Write-Host "✅ Switching browser tabs automatically every $Interval seconds..."
Write-Host " (click into the browser window to activate it, press Ctrl + C here to stop it)"
$obj = New-Object -com wscript.shell
for ([int]$i = 0; $i -lt 1000; $i++) {
while ($true) {
$obj.SendKeys("^{PGDN}")
Start-Sleep -seconds $Interval
}