Show menu of all open windows

Share your macros, knowledge, solutions, services, ...
Post Reply
Petr
Posts: 106
Joined: Tue Oct 18, 2016 1:12 pm

Show menu of all open windows

Post by Petr » Fri Nov 25, 2016 12:57 pm

This macro shows a menu of all open windows (applications) and brings to top the selected.

Code: Select all

<#> Start of the macro
<#> Only commands takes effect in the macro, new lines and other text is ignored
<cmds>

<#> Enumerate all visible and store number in to variable vNumOfWindows 
<win_enumerate>(vWindow,vNumOfWindows,0)

<#> If is any visible window... 
<if_num>("vNumOfWindows>0")

   <#> For all window   
   <begloop>(vNumOfWindows)

      <#> If current window caption is not empty 
      <if_str>("vWindow[_vLoopCounter0]!=_vStrEmpty")

         <#> Add caption of window (application) in to menu
         <menu_additem>("vWindow[_vLoopCounter0]")

      <endif>

   <endloop>

   <#> Show menu with list of opned windows-applications  
   <menu_show>(-1,-1,vWindowSelected,1,1)

   <#> If any item of menu selected
   <if_str>("vWindowSelected!=NO")

      <#> Activate selected window-application  
      <actwin>("vWindowSelected",0,0,"no")

   <endif>

<endif>
<#> End of the macro

Post Reply