Tuesday 4 December 2012

Cycle through open applications


I was trying to setup team display. It supposed to display JIRA, build monitoring etc. And rotate this windows one after another after a certain interval. Finally one of my colleague give me this little script and it worked like charm. Here it is:
Its a VBS script. works in Microsoft windows.

1. Save following five line of script in a text file with .vbs file extension.
set objShell = CreateObject("Wscript.Shell")
While true
    objShell.SendKeys "%{TAB 11}"
     Wscript.sleep 10000
Wend


2. Change the number 11 (after TAB) to the number of open application that you want to cycle through

3. Save the file. 

4. Open all your applications that you want to cycle through

5. Run the script, simply by double clicking it.

It going to change screen every ten seconds. To stop the script you have to kill the Wscript shell. For that, open task manager, go the process tab and find wscript.exe and kill it. There may be multiple wscript instance running. And you may not have access to kill them all. Don't worry. 


The above loop run in a infinite loop, to make it finite you can use something like this :

set objShell = CreateObject("Wscript.Shell")
for i = 1 to 10000000
    objShell.SendKeys "%{TAB 11}"
    i = i + 1
    Wscript.sleep 10000
Next

No comments:

Post a Comment