Jump to content
Macro Express Forums

Arrange all open File Explorer folders?


Recommended Posts

I hope to soon start developing a macro I've been putting off for months. But I'd first appreciate hearing if anyone has already invented this particular wheel please? (Or know of a tool, fee/free, that does it reliably?)

 

I want it to arrange all open FE folders to fill the screen, on top of everything else. Ideally filling all the screen with similar sized windows up to a maximum of a user-settable max. Which I'd probably set to eight, i.e  4 columns across, 2 rows high. Maybe choosing the folders in order from left to right as displayed when the FE icon is hovered in the taskbar. If there are more than the max open, various ideas arise. For example, the max could be ignored and the windows sized wide enough for their titles to be read, sacrificing height. But I'll probably start by ignoring that interesting diversion.

 

I already have the advantage of various size/positioning macros. But they operate on an individual active FE folder. I'm increasing impatient for something more helpful, especially if I have a dozen or so folders open. Eventually I'd like to extend it to app windows as well, but FE is the immediate focus.

 

Terry

Link to comment
Share on other sites

Hi Terry,

 

Insight Software got rid of several Macro Express instructions that may have helped accomplish what you're trying to do, possibly because Windows 10 no longer fully supports these functions. Here's a screen shot from a bygone era:

 

image.png.4028ab9e97bd369e5ba601a2c6129e62.png

 

When I right-click a blank area of the Windows 10 system tray, a menu appears, which has two interesting options:

 

image.thumb.png.2652e820a0d415b2bf1240095fb2e928.png

However, when I try these two promising-looking options, nothing happens.

 

So the solution may be doing fancy stuff with Macro Express. It sounds do-able.

  

Link to comment
Share on other sites

Hi Alan,

 

Thanks for the quick reply.  Yes, those potentially useful options behave in different ways depending on whether windows are open or minimised. The latter type do not participate. So if all are minimised you'll see no change in your screen's appearance. So for my requirement, when some will be open and others minimised, the tools don't help. Also, they act on both FE folders and all other apps, which is another snag.

 

I've made progress with a compromise since posting: a macro that will open a specific set of 8 folders I want to work with frequently over the next few days,  and arrange them in two rows of 4. But it's very slow at 32 secs. I don't understand why, because I already have 8 macros that place the currently active window in one of those 8 positions, and that's 'immediate'. So I'd expect a couple  of seconds, not 32! Whatever variations I tried it remained 32 s. Even tried opening each via the Run box. I'll show it below for any suggestions. May also be useful to others.

 

Note that I'm using Wait for Window Title and the Delays are disabled, but results are identical with either, and with all others I tried.

 

<COMMENT Value="Arduino (Sundry)"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino (Sundry)"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="Arduino (Sundry)" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 1) (a+F1)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="Arduino PROJECTS"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="Arduino PROJECTS" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 2) (a+F2)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DfRobot PROJECTS"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFRobot PROJECTS" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 3) (a+F3)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DFR-Pro proj"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS\\DFR-Pro proj"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFR-Pro proj" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 4) (a+F5)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DFR-SD proj"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS\\DFR-SD proj"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFR-SD proj" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Bot 1) (a+F6)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DFR-Music"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS\\DFR-Music"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFR-Music" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Bot 2) (a+F7)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="MY SKETCHES 2021"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\SKETCHES\\My Sketches\\MY SKETCHES 2021"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="MY SKETCHES 2021" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Bot 3) (a+F8)" ID="-1" Wait="TRUE"/>
<COMMENT/>

 

<COMMENT Value="Arduino (Sundry)"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino (Sundry)"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="Arduino (Sundry)" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 1) (a+F1)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="Arduino PROJECTS"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="Arduino PROJECTS" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 2) (a+F2)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DfRobot PROJECTS"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFRobot PROJECTS" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 3) (a+F3)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DFR-Pro proj"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS\\DFR-Pro proj"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFR-Pro proj" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Top 4) (a+F5)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DFR-SD proj"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS\\DFR-SD proj"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFR-SD proj" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Bot 1) (a+F6)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="DFR-Music"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\Arduino PROJECTS\\DfRobot PROJECTS\\DFR-Music"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="DFR-Music" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Bot 2) (a+F7)" ID="-1" Wait="TRUE"/>
<COMMENT/>
<COMMENT Value="MY SKETCHES 2021"/>
<OPEN FOLDER Path="C:\\Users\\terry\\Dropbox\\Electronics\\Arduino\\SKETCHES\\My Sketches\\MY SKETCHES 2021"/>
<DELAY Flags="\x01" Time="0.3" _ENABLED="FALSE"/>
<WAIT FOR WINDOW TITLE Title="MY SKETCHES 2021" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<MACRO RUN Use_ID="FALSE" Name="Current window 480x586 (Bot 3) (a+F8)" ID="-1" Wait="TRUE"/>
<COMMENT/>

 

 

 

 

Link to comment
Share on other sites

This script runs quickly. Maybe calling macros is responsible for making yours run slowly?

 

Note that the text of the title bars of some of the instances of Windows Explorer are different than the path.

 

I needed to insert delays between the repositioning lines. I think that's because my computer is on the slow side. You may discover that the delay statements aren't required on your computer.

 

// Window 1
Open Folder to "C:\Users\Alan\Downloads"
 
// Window 2
Open Folder to "C:\"
 
// Window 3
Open Folder to "C:\Users\Alan\Pictures"
 
// Window 4
Open Folder to "C:\Users\Alan\Saved Games"
 
Window Reposition: Downloads Move to the top-left corner
Delay: 200 milliseconds
Window Reposition: c:\ Move to the top-right corner
Delay: 200 milliseconds
Window Reposition: Pictures Move to the bottom-left corner
Delay: 200 milliseconds
Window Reposition: C:\Users\Alan\Saved Games Move to the bottom-right corner


<COMMENT Value="Window 1"/>
<OPEN FOLDER Path="C:\\Users\\Alan\\Downloads"/>
<COMMENT/>
<COMMENT Value="Window 2"/>
<OPEN FOLDER Path="C:\\"/>
<COMMENT/>
<COMMENT Value="Window 3"/>
<OPEN FOLDER Path="C:\\Users\\Alan\\Pictures"/>
<COMMENT/>
<COMMENT Value="Window 4"/>
<OPEN FOLDER Path="C:\\Users\\Alan\\Saved Games"/>
<COMMENT/>
<WINDOW REPOSITION Option="\x01" Title="Downloads" Partial="FALSE" Wildcards="FALSE" Method="\x02" Left="0" Top="0" Monitor="0" _IGNORE="0x0006"/>
<DELAY Flags="\x02" Time="200"/>
<WINDOW REPOSITION Option="\x01" Title="c:\\" Partial="FALSE" Wildcards="FALSE" Method="\x04" Left="0" Top="0" Monitor="0" _IGNORE="0x0006"/>
<DELAY Flags="\x02" Time="200"/>
<WINDOW REPOSITION Option="\x01" Title="Pictures" Partial="FALSE" Wildcards="FALSE" Method="\x07" Left="0" Top="0" Monitor="0" _IGNORE="0x0006"/>
<DELAY Flags="\x02" Time="200"/>
<WINDOW REPOSITION Option="\x01" Title="C:\\Users\\Alan\\Saved Games" Partial="FALSE" Wildcards="FALSE" Method="\x09" Left="0" Top="0" Monitor="0" _IGNORE="0x0006"/>

 

  • Like 1
Link to comment
Share on other sites

Here are two macros to play with and refine as desired.  They are not 100 percent checked out.  The first just initializes some variables, and probably never has to be manually run.  The second macro seems to be working pretty well.  It dynamically tiles up to eight windows of any sort.  When a window has focus, invoke the macro to add it to the list to be tiled.  Up to three windows are tiled horizontally in one row.  Four through eight windows are tiled in two rows.  On my monitor, eight tiles are pretty small to work with.  If you close any window previously selected, all other selected windows are dropped from the tiling.  


<COMMENT Value=" "/>
<LOG ERRORS Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Hide_Errors="TRUE"/>
<LOG MESSAGES Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Message="Macro executed: Tile_1" Stamp="TRUE"/>
<COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<KEYSTROKE SPEED Delay="10"/>
<MOUSE SPEED Delay="30"/>
<COMMENT Value=" "/>
<COMMENT Value="Line Feed (New Line) character ascii 10"/>
<VARIABLE SET TO ASCII CHAR Value="10" Destination="%LINEFEED%"/>
<COMMENT Value="Carriage Return character ascii 13"/>
<VARIABLE SET TO ASCII CHAR Value="13" Destination="%CARRIAGERETURN%"/>
<COMMENT Value="Carriage Return / Line Feed combination characters ascii 13 + ascii 10"/>
<VARIABLE SET TO ASCII CHAR Value="13" Destination="%CRLF%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%CRLF%" Variable="%LINEFEED%" NoEmbeddedVars="FALSE"/>
<COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<COMMENT Value=" "/>
<COMMENT Value="Macro clears the variables used in cascading windows, and saves them for use by the cascading macro"/>
<COMMENT Value=" "/>
<COMMENT Value="Clear variables previously stored, if any, then save them for use by tiling macro"/>
<REPEAT START Start="1" Step="1" Count="9" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%indx%" Condition="\x00" Value="9" IgnoreCase="FALSE"/>
<VARIABLE SET STRING Option="\x00" Destination="%w_name[%indx%]%" Value="End of Table" NoEmbeddedVars="FALSE" _COMMENT="array"/>
<ELSE/>
<VARIABLE SET STRING Option="\x00" Destination="%w_name[%indx%]%" Value="*" NoEmbeddedVars="FALSE" _COMMENT="array"/>
<END IF/>
<VARIABLE SET INTEGER Option="\x00" Destination="%w_top[%indx%]%" Value="0" _COMMENT="array"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%w_left[%indx%]%" Value="0" _COMMENT="array"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%w_width[%indx%]%" Value="0" _COMMENT="array"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%w_height[%indx%]%" Value="0" _COMMENT="array"/>
<END REPEAT/>
<COMMENT Value=" "/>
<VARIABLE SAVE Option="\x01"/>
<VARIABLE SAVE Option="\x02"/>
<COMMENT Value=" "/>
<VARIABLE SET STRING Option="\x00" Destination="%textbox%" NoEmbeddedVars="FALSE" _COMMENT="Diagnostic display of variables"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="Macro \"Tile_1\" has reset list of windows to be tiled" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<REPEAT START Start="1" Step="1" Count="9" Save="TRUE" Variable="%indx%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%w_name[%indx%]%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_top[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_left[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_width[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_height[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<END REPEAT/>
<TEXT BOX DISPLAY Title="Diagnostics" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %textbox%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="923" Height="440" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
<COMMENT Value=" "/>
<MACRO RETURN/>
<COMMENT Value=" "/>

 

 

 

 

 

<COMMENT Value=" "/>
<LOG ERRORS Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Hide_Errors="TRUE"/>
<LOG MESSAGES Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Message="Macro executed: Tile_2" Stamp="TRUE"/>
<COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<KEYSTROKE SPEED Delay="10"/>
<MOUSE SPEED Delay="30"/>
<COMMENT Value=" "/>
<COMMENT Value="Line Feed (New Line) character ascii 10"/>
<VARIABLE SET TO ASCII CHAR Value="10" Destination="%LINEFEED%"/>
<COMMENT Value="Carriage Return character ascii 13"/>
<VARIABLE SET TO ASCII CHAR Value="13" Destination="%CARRIAGERETURN%"/>
<COMMENT Value="Carriage Return / Line Feed combination characters ascii 13 + ascii 10"/>
<VARIABLE SET TO ASCII CHAR Value="13" Destination="%CRLF%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%CRLF%" Variable="%LINEFEED%" NoEmbeddedVars="FALSE"/>
<COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<COMMENT Value=" "/>
<COMMENT Value="Macro tiles present window and all others previously selected for tiling"/>
<COMMENT Value=" "/>
<COMMENT Value="Restore variables previously stored "/>
<VARIABLE RESTORE Option="\x01"/>
<VARIABLE RESTORE Option="\x02"/>
<COMMENT Value=" "/>
<COMMENT Value="If any previously selected window has been closed, clear entire table of windows "/>
<COMMENT Value="Also clear if slot 9 of table does not equal \"End of Table\""/>
<IF VARIABLE Variable="%w_name[9]%" Condition="\x01" Value="End of Table" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???"/>
<MACRO RUN Use_ID="FALSE" Name="Tile_1" ID="-1" Wait="TRUE" _COMMENT="Run macro that clears table"/>
<VARIABLE RESTORE Option="\x01"/>
<VARIABLE RESTORE Option="\x02"/>
<END IF/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x01" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???"/>
<IF WINDOW Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE"/>
<ELSE/>
<MACRO RUN Use_ID="FALSE" Name="Tile_1" ID="-1" Wait="TRUE" _COMMENT="Run macro that clears table"/>
<VARIABLE RESTORE Option="\x01"/>
<VARIABLE RESTORE Option="\x02"/>
<REPEAT EXIT/>
<END IF/>
<END IF/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value="Find name of present window, store name in array if not already there "/>
<REPEAT WITH WINDOWS ToRetrieve="\x01" SortOrder="\x01" Destination="%present_window%"/>
<IF WINDOW Option="\x00" Title="%present_window%" Partial="FALSE" Wildcards="FALSE"/>
<TEXT BOX DISPLAY Title="Diagnostics" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %present_window%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="%present_window%" IgnoreCase="FALSE" _COMMENT="present window already in table???"/>
<REPEAT EXIT/>
<ELSE/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???"/>
<VARIABLE MODIFY STRING Option="\x08" Destination="%w_name[%indx%]%" Variable="%present_window%" NoEmbeddedVars="FALSE" _COMMENT="yes, empty slot, insert name of present window into table"/>
<REPEAT EXIT/>
<END IF/>
<END IF/>
<END REPEAT/>
<END IF/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value="AT THIS POINT THE W_NAME ARRAY CONTAINS PREVIOUSLY SELECTED WINDOWS PLUS THE ONE SELECTED BY THIS RUN OF THE MACRO "/>
<COMMENT Value=" "/>
<COMMENT Value="Count how many window have been selected for tiling, previously and now "/>
<VARIABLE SET INTEGER Option="\x00" Destination="%win_count%" Value="0"/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x01" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???"/>
<VARIABLE MODIFY INTEGER Option="\x07" Destination="%win_count%" _COMMENT="no, add to count of windows to be tiled"/>
<END IF/>
<END REPEAT/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="0" IgnoreCase="FALSE" _COMMENT="If no windows to be tiled, exit from macro"/>
<VARIABLE SAVE Option="\x01" _COMMENT="Save updated state of all variables "/>
<VARIABLE SAVE Option="\x02"/>
<MACRO RETURN/>
<END IF/>
<TEXT BOX DISPLAY Title="Diagnostics" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %win_count% windows to be tiled\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<COMMENT Value=" "/>
<COMMENT Value="Get display width and height, hard-code base location for top-left tile "/>
<VARIABLE SET INTEGER Option="\x06" Destination="%scrn_width%"/>
<VARIABLE SET INTEGER Option="\x07" Destination="%scrn_height%"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_base_top%" Value="0" _COMMENT="Change this if you want tiling to start at other than 0,0"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_base_left%" Value="0" _COMMENT="Change this if you want tiling to start at other than 0,0"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%scrn_height%" Value1="%scrn_height%" Value2="%tile_base_top%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%scrn_width%" Value1="%scrn_width%" Value2="%tile_base_left%"/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value="Compute size for tiling maximum four windows across and two down "/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="1" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="2"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="1"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="1"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="2" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="2"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="1"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="1"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="3" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="3"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="1"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="1"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="4" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="2"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="2"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="2"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x03" Value="4" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="4"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="2"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="2"/>
<END IF/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value="Plug winlow locations and sizes into arrays "/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%" _COMMENT="set leftmost tile position to negative location"/>
<IF VARIABLE Variable="%win_count%" Condition="\x03" Value="0" IgnoreCase="FALSE" _COMMENT="If no windows to be tiled, exit macro."/>
<ELSE/>
<VARIABLE SAVE Option="\x01" _COMMENT="Save updated state of all variables "/>
<VARIABLE SAVE Option="\x02"/>
<MACRO RETURN/>
<END IF/>
<REPEAT START Start="1" Step="1" Count="%win_count%" Save="TRUE" Variable="%indx%"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???  If so, quit tiling."/>
<REPEAT EXIT/>
<END IF/>
<IF VARIABLE Variable="%tile_rows%" Condition="\x00" Value="2" IgnoreCase="FALSE" _COMMENT="If done with top row of 2 out of 4 total tiles, reset tile location pointers for bottom row of tiles"/>
<AND/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="4" IgnoreCase="FALSE"/>
<AND/>
<IF VARIABLE Variable="%indx%" Condition="\x00" Value="3" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%tile_base_top%" Value1="%tile_base_top%" Value2="%tile_height%"/>
<END IF/>
<IF VARIABLE Variable="%tile_rows%" Condition="\x00" Value="2" IgnoreCase="FALSE" _COMMENT="If done with top row of 4 out of more than 4 total tiles, reset tile location pointers for bottom row of tiles"/>
<AND/>
<IF VARIABLE Variable="%win_count%" Condition="\x03" Value="4" IgnoreCase="FALSE"/>
<AND/>
<IF VARIABLE Variable="%indx%" Condition="\x00" Value="5" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%tile_base_top%" Value1="%tile_base_top%" Value2="%tile_height%"/>
<END IF/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_top[%indx%]%" Variable="%tile_base_top%"/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_left[%indx%]%" Variable="%tile_base_left%"/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_width[%indx%]%" Variable="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_height[%indx%]%" Variable="%tile_height%"/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value="Place the window tiles on the screen "/>
<MINIMIZE ALL WINDOWS/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???  If so, quit tiling."/>
<REPEAT EXIT/>
<END IF/>
<WINDOW ACTIVATE Title="%w_name[%indx%]%" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
<WINDOW SHOW Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<DELAY Flags="\x13" Time="999" _ENABLED="FALSE"/>
<WINDOW MINIMIZE Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" _IGNORE="0x0006" _ENABLED="FALSE"/>
<WINDOW MOVE AND SIZE Use_Current="FALSE" Title="%w_name[%indx%]%" Exact_Match="TRUE" Use_Wildcards="FALSE" Left="%w_left[%indx%]%" Top="%w_top[%indx%]%" Width="%w_width[%indx%]%" Height="%w_height[%indx%]%" Monitor="0"/>
<WINDOW RESIZE Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" Method="\x00" Width="%tile_width%" Height="%tile_height%" _IGNORE="0x0006" _ENABLED="FALSE"/>
<WINDOW REPOSITION Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" Method="\x00" Left="%tile_base_left%" Top="%tile_base_top%" Monitor="0" _IGNORE="0x0006" _ENABLED="FALSE"/>
<DELAY Flags="\x13" Time="999" _ENABLED="FALSE"/>
<TEXT BOX DISPLAY Title="halt" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Press Enter to continue with next window\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value="Save updated state of all variables  "/>
<VARIABLE SAVE Option="\x01" _COMMENT="Save updated state of all variables "/>
<VARIABLE SAVE Option="\x02"/>
<COMMENT Value=" "/>
<COMMENT Value="Diagnostic display of variables "/>
<VARIABLE SET STRING Option="\x00" Destination="%textbox%" NoEmbeddedVars="FALSE" _COMMENT="Diagnostic display of variables"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="tile rows = " NoEmbeddedVars="FALSE" _COMMENT="************************"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%tile_rows%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="tile height = " NoEmbeddedVars="FALSE" _COMMENT="************************"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%tile_height%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="tile width = " NoEmbeddedVars="FALSE" _COMMENT="************************"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%tile_width%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="Window Name - Top - Left - Height - Width" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%" _COMMENT="************************"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%w_name[%indx%]%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_top[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_left[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_height[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_width[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<END REPEAT/>
<TEXT BOX DISPLAY Title="Diagnostics" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %textbox%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="923" Height="440" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<COMMENT Value=" "/>
<MACRO RETURN/>
<COMMENT Value=" "/>

 

 

Link to comment
Share on other sites

Alan,

 

Thanks, played with my edited version of that briefly yesterday (just changing folder paths) but had some difficulty getting windows into specified positions. Meanwhile have a project deadline (electronics, Christmas gift, not macros), but will return to it shortly. I think it's a matter of fine-tuning the size/position delays, with some added after each folder opening too.

 

Link to comment
Share on other sites

@rberq,

 

Thanks, looks very promising, but I hit some snags. I should have methodically studied it beforehand but impatiently I just ran the first macro with F9 and assigned all your variables. My MX Pro icon then disappeared from the tray. And despite Task Mgr showing that MacExp.exe was still loaded I could not  trigger any macros. After a reboot I installed and ran your main macro, but that crashed not only MX Pro but all other apps. I've forcibly re-started Win 10 but I won't try either macro again until I've thoroughly investigated.

 

FWIW the file C:\temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt

now contains this:

13 December 2021 09:02:41:204: Macro executed: Tile_1
13 December 2021 09:40:52:485: Macro executed: Tile_2

 

 

Link to comment
Share on other sites

3 hours ago, terrypin said:

I installed and ran your main macro, but that crashed not only MX Pro but all other apps

WOW!!!  It hasn't been that "effective" on my PC.  Biggest problem I ran into during testing was that some window coordinates were mis-calculated and the windows were placed entirely outside the screen.  Notepad disappeared completely even when I restarted it several times, and rebooted, because Notepad uses last-known window position when it starts.  So it was running but invisible.  Fortunately Google pointed me to a fix. 

 

Anyway, if you dare to try it, here is the latest version with some positioning bugs cleaned up. 

 

<COMMENT Value=" "/>
<LOG ERRORS Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Hide_Errors="TRUE"/>
<LOG MESSAGES Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Message="Macro executed: Tile_2" Stamp="TRUE"/>
<COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<KEYSTROKE SPEED Delay="10"/>
<MOUSE SPEED Delay="30"/>
<COMMENT Value=" "/>
<COMMENT Value="Line Feed (New Line) character ascii 10"/>
<VARIABLE SET TO ASCII CHAR Value="10" Destination="%LINEFEED%"/>
<COMMENT Value="Carriage Return character ascii 13"/>
<VARIABLE SET TO ASCII CHAR Value="13" Destination="%CARRIAGERETURN%"/>
<COMMENT Value="Carriage Return / Line Feed combination characters ascii 13 + ascii 10"/>
<VARIABLE SET TO ASCII CHAR Value="13" Destination="%CRLF%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%CRLF%" Variable="%LINEFEED%" NoEmbeddedVars="FALSE"/>
<COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<COMMENT Value=" "/>
<COMMENT Value="Macro tiles present window and all others previously selected for tiling"/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value="Restore variables previously stored "/>
<VARIABLE RESTORE Option="\x01"/>
<VARIABLE RESTORE Option="\x02"/>
<COMMENT Value=" "/>
<COMMENT Value="If any previously selected window has been closed, clear entire table of windows "/>
<COMMENT Value="Also clear if slot 9 of table does not equal \"End of Table\""/>
<IF VARIABLE Variable="%w_name[9]%" Condition="\x01" Value="End of Table" IgnoreCase="FALSE" _COMMENT="is last table slot formatted???"/>
<MACRO RUN Use_ID="FALSE" Name="Tile_1" ID="-1" Wait="TRUE" _COMMENT="Run macro that clears table"/>
<VARIABLE RESTORE Option="\x01"/>
<VARIABLE RESTORE Option="\x02"/>
<END IF/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x01" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???"/>
<IF WINDOW Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE"/>
<ELSE/>
<MACRO RUN Use_ID="FALSE" Name="Tile_1" ID="-1" Wait="TRUE" _COMMENT="Run macro that clears table"/>
<VARIABLE RESTORE Option="\x01"/>
<VARIABLE RESTORE Option="\x02"/>
<REPEAT EXIT/>
<END IF/>
<END IF/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value="Find name of present window, store name in array if not already there "/>
<REPEAT WITH WINDOWS ToRetrieve="\x01" SortOrder="\x01" Destination="%present_window%"/>
<IF WINDOW Option="\x00" Title="%present_window%" Partial="FALSE" Wildcards="FALSE"/>
<TEXT BOX DISPLAY Title="Diagnostics" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %present_window%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="%present_window%" IgnoreCase="FALSE" _COMMENT="present window already in table???"/>
<REPEAT EXIT/>
<ELSE/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???"/>
<VARIABLE MODIFY STRING Option="\x08" Destination="%w_name[%indx%]%" Variable="%present_window%" NoEmbeddedVars="FALSE" _COMMENT="yes, empty slot, insert name of present window into table"/>
<REPEAT EXIT/>
<END IF/>
<END IF/>
<END REPEAT/>
<END IF/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value="AT THIS POINT THE W_NAME ARRAY CONTAINS PREVIOUSLY SELECTED WINDOWS PLUS THE ONE SELECTED BY THIS RUN OF THE MACRO "/>
<COMMENT Value=" "/>
<COMMENT Value="Count how many window have been selected for tiling, previously and now "/>
<VARIABLE SET INTEGER Option="\x00" Destination="%win_count%" Value="0"/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x01" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???"/>
<VARIABLE MODIFY INTEGER Option="\x07" Destination="%win_count%" _COMMENT="no, add to count of windows to be tiled"/>
<END IF/>
<END REPEAT/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="0" IgnoreCase="FALSE" _COMMENT="If no windows to be tiled, exit from macro"/>
<VARIABLE SAVE Option="\x01" _COMMENT="Save updated state of all variables "/>
<VARIABLE SAVE Option="\x02"/>
<MACRO RETURN/>
<END IF/>
<TEXT BOX DISPLAY Title="Diagnostics" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %win_count% windows to be tiled\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<COMMENT Value=" "/>
<COMMENT Value="Get display width and height, hard-code base location for top-left tile "/>
<VARIABLE SET INTEGER Option="\x06" Destination="%scrn_width%"/>
<VARIABLE SET INTEGER Option="\x07" Destination="%scrn_height%"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_base_top%" Value="3" _COMMENT="Change this if you want tiling to start at other than 0,0"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_base_left%" Value="3" _COMMENT="Change this if you want tiling to start at other than 0,0"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%scrn_height%" Value1="%scrn_height%" Value2="%tile_base_top%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%scrn_width%" Value1="%scrn_width%" Value2="%tile_base_left%"/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value="Compute size for tiling maximum four windows across and two down "/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="1" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="2"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="1"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="1"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="2" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="2"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="1"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="1"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="3" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="3"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="1"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="1"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="4" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="2"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="2"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="2"/>
<END IF/>
<IF VARIABLE Variable="%win_count%" Condition="\x03" Value="4" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_width%" Value1="%scrn_width%" Value2="4"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%tile_height%" Value1="%scrn_height%" Value2="2"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%tile_rows%" Value="2"/>
<END IF/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value="Plug winlow locations and sizes into arrays "/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%" _COMMENT="set leftmost tile position to negative location"/>
<IF VARIABLE Variable="%win_count%" Condition="\x03" Value="0" IgnoreCase="FALSE" _COMMENT="If no windows to be tiled, exit macro."/>
<ELSE/>
<VARIABLE SAVE Option="\x01" _COMMENT="Save updated state of all variables "/>
<VARIABLE SAVE Option="\x02"/>
<MACRO RETURN/>
<END IF/>
<REPEAT START Start="1" Step="1" Count="%win_count%" Save="TRUE" Variable="%indx%"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???  If so, quit tiling."/>
<REPEAT EXIT/>
<END IF/>
<IF VARIABLE Variable="%tile_rows%" Condition="\x00" Value="2" IgnoreCase="FALSE" _COMMENT="If done with top row of 2 out of 4 total tiles, reset tile location pointers for bottom row of tiles"/>
<AND/>
<IF VARIABLE Variable="%win_count%" Condition="\x00" Value="4" IgnoreCase="FALSE"/>
<AND/>
<IF VARIABLE Variable="%indx%" Condition="\x00" Value="3" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%tile_base_top%" Value1="%tile_base_top%" Value2="%tile_height%"/>
<END IF/>
<IF VARIABLE Variable="%tile_rows%" Condition="\x00" Value="2" IgnoreCase="FALSE" _COMMENT="If done with top row of 4 out of more than 4 total tiles, reset tile location pointers for bottom row of tiles"/>
<AND/>
<IF VARIABLE Variable="%win_count%" Condition="\x03" Value="4" IgnoreCase="FALSE"/>
<AND/>
<IF VARIABLE Variable="%indx%" Condition="\x00" Value="5" IgnoreCase="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%tile_base_left%" Value1="%tile_base_left%" Value2="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%tile_base_top%" Value1="%tile_base_top%" Value2="%tile_height%"/>
<END IF/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_top[%indx%]%" Variable="%tile_base_top%"/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_left[%indx%]%" Variable="%tile_base_left%"/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_width[%indx%]%" Variable="%tile_width%"/>
<VARIABLE MODIFY INTEGER Option="\x06" Destination="%w_height[%indx%]%" Variable="%tile_height%"/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value="Place the window tiles on the screen "/>
<MINIMIZE ALL WINDOWS _ENABLED="FALSE" _COMMENT="Minimize all windows"/>
<TEXT TYPE Action="0" Text="<WIND>d<WINU>" _COMMENT="Show desktop"/>
<REPEAT START Start="1" Step="1" Count="8" Save="TRUE" Variable="%indx%"/>
<IF VARIABLE Variable="%w_name[%indx%]%" Condition="\x00" Value="*" IgnoreCase="FALSE" _COMMENT="is this table slot empty (asterisk)???  If so, quit tiling."/>
<REPEAT EXIT/>
<END IF/>
<WINDOW ACTIVATE Title="%w_name[%indx%]%" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
<DELAY Flags="\x13" Time="999" _ENABLED="FALSE"/>
<WINDOW MAXIMIZE Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<WINDOW SHOW Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<DELAY Flags="\x13" Time="999" _ENABLED="FALSE"/>
<WINDOW MINIMIZE Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" _IGNORE="0x0006" _ENABLED="FALSE"/>
<WINDOW MOVE AND SIZE Use_Current="FALSE" Title="%w_name[%indx%]%" Exact_Match="TRUE" Use_Wildcards="FALSE" Left="%w_left[%indx%]%" Top="%w_top[%indx%]%" Width="%w_width[%indx%]%" Height="%w_height[%indx%]%" Monitor="0"/>
<WINDOW RESIZE Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" Method="\x00" Width="%tile_width%" Height="%tile_height%" _IGNORE="0x0006" _ENABLED="FALSE"/>
<WINDOW REPOSITION Option="\x01" Title="%w_name[%indx%]%" Partial="FALSE" Wildcards="FALSE" Method="\x00" Left="%tile_base_left%" Top="%tile_base_top%" Monitor="0" _IGNORE="0x0006" _ENABLED="FALSE"/>
<DELAY Flags="\x13" Time="999" _ENABLED="FALSE"/>
<TEXT BOX DISPLAY Title="halt" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Press Enter to continue with next window\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<END REPEAT/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value=" "/>
<COMMENT Value="Save updated state of all variables  "/>
<VARIABLE SAVE Option="\x01" _COMMENT="Save updated state of all variables "/>
<VARIABLE SAVE Option="\x02"/>
<COMMENT Value=" "/>
<COMMENT Value="Diagnostic display of variables "/>
<VARIABLE SET STRING Option="\x00" Destination="%textbox%" NoEmbeddedVars="FALSE" _COMMENT="Diagnostic display of variables"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="tile rows = " NoEmbeddedVars="FALSE" _COMMENT="************************"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%tile_rows%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="tile height = " NoEmbeddedVars="FALSE" _COMMENT="************************"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%tile_height%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="tile width = " NoEmbeddedVars="FALSE" _COMMENT="************************"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%tile_width%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="Window Name - Top - Left - Height - Width" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<REPEAT START Start="1" Step="1" Count="9" Save="TRUE" Variable="%indx%" _COMMENT="************************"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%w_name[%indx%]%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_top[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_left[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_height[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x06" Destination="%textbox%" Value="   " NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY INTEGER Option="\x04" Destination="%w_width[%indx%]%" Variable="%text%"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%text%" NoEmbeddedVars="FALSE"/>
<VARIABLE MODIFY STRING Option="\x07" Destination="%textbox%" Variable="%CRLF%" NoEmbeddedVars="FALSE"/>
<END REPEAT/>
<TEXT BOX DISPLAY Title="Diagnostics" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %textbox%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="923" Height="440" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/>
<COMMENT Value=" "/>
<MACRO RETURN/>
<COMMENT Value=" "/>

 

Link to comment
Share on other sites

Alan,

 

Could you try your macro with a few deeper paths please? Here my version fails with folders such as this:

C:\Users\terry\Dropbox\A folder for temp stuff

 

Yet it opened this OK:

C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\My Sketches\MY SKETCHES 2021\DFMiniSD Sketches

 

It's also failing with one of yours I used unchanged, namely C:\

Interestingly our window titles for that differ too, as you see.

 

 

 

 

C-AlanTerry.jpg

Link to comment
Share on other sites

Hi Terry,

 

I tried again with three folders eight and nine levels deep into the folder hierarchy, as well as with the existing c drive path.

 

It worked.

 

Curious that the title for the c drive is different for us. Could the difference be a function of the display theme? Regional settings? Cosmic rays passing through one of our computers and randomly changing a bit?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...