viewpoint-particle

Author Topic: Toggling between screens in desktop  (Read 449 times)

jm0000

  • Newbie
  • *
  • Posts: 13
Toggling between screens in desktop
« on: April 20, 2018, 10:25:44 am »
I have a big monitor that will be used to display several statistics.  A while back, using the old version of winbatch, I wrote a script that toggled between all the screens that were open in the desktop.  This script worked great, but that was on XP.  I'm trying to re-write the same script, but  Win10 is ignoring the command to flip the screens.  What is the best way to do this  using winbatch, ruining on win10. Here is what I have:

for i =  1 to  %countvar%
counter = %counter% -1
    Display(1,"Changing windows in","%counter%")
next i
  if IsKeyDown(@SHIFT) then goto end

;SendKey( '^!{TAB}~ {ENTER}"' )     ;Sends Keystrokes
sendkey("^{ALT}{ESC}")

end

td

  • Tech Support
  • *****
  • Posts: 2595
    • WinBatch
Re: Toggling between screens in desktop
« Reply #1 on: April 20, 2018, 01:37:26 pm »
You might try Window key + tab to open Task View or Atl + tab to switch between open apps.   Things can get a little tricky because Windows 10 has better support for virtual desktops.

The complete list of shortcuts for Windows 10 can be found here:

https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


jm0000

  • Newbie
  • *
  • Posts: 13
Re: Toggling between screens in desktop
« Reply #2 on: April 20, 2018, 03:09:18 pm »
Thanks for your reply. I really wanted to just toggle between all the open windows, like the old program, but that has proven difficult. I rewrote it just to open specific windows, but I am having an issues opening a google chrome window. Here is what I have

:again
     If Iskeydown(@CTRL) then goto end
    Display(1,"Changing windows in","%countvar% seconds")
   winactivate("Inbox") <-- opens email
    If Iskeydown(@CTRL) then goto end
    delay(countvar)   
  winactivate("MyDoc") <-- Opens word
   If Iskeydown(@CTRL) then goto end
  delay(countvar)

;can't open an existing chrome window
ActivateIeTab("winbatch.com")  <--- How can I activate an exiting chrome tab?

:goto agiain

td

  • Tech Support
  • *****
  • Posts: 2595
    • WinBatch
Re: Toggling between screens in desktop
« Reply #3 on: April 22, 2018, 08:54:53 am »
If you start "WinBatch Navigator" and press the "Windows Information" button the applet "Wininfo" starts.  Put the cursor over your Chrome window to see it's window title.   You may need to use a "partial window name" to account for the title changing based on the Website being displayed.   You can find more information on partial window names in the Consolidated WIL Help file.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


jm0000

  • Newbie
  • *
  • Posts: 13
Re: Toggling between screens in desktop
« Reply #4 on: April 23, 2018, 08:54:23 am »
Thanks TD, the tip about the navigator helped me out. Here is the basic code. This will work. I'm going to make is more professional by using a data file to list the names of windows I would like to open.

:again

   winactivate("an adbode program") <-- just change this to the file name of any file you want to open
    If Iskeydown(@CTRL) then goto end
    delay(countvar)   
  winactivate("Am excel spreedsheet")
   If Iskeydown(@CTRL) then goto end
  delay(countvar)
       winactivate("a word doc")
   If Iskeydown(@CTRL) then goto end
  delay(countvar)




;; This will open google chrome pages.

Winactivate("WinBatch Navigator")
        If Iskeydown(@CTRL) then goto end
     delay(countvar)
Winactivate("CNN")
 If Iskeydown(@CTRL) then goto end
delay(countvar)
Winactivate("Home")
 If Iskeydown(@CTRL) then goto end
 delay(countvar)
goto again

:end
Display(3,"END of swtab","Closing Swtab script")