mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-15 19:21:04 +01:00
Update switch-tabs.ps1
This commit is contained in:
parent
762c7a0dd2
commit
f49d4f659d
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user