Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,000
  • Joined

  • Last visited

  • Days Won

    44

rberq last won the day on July 5

rberq had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rberq's Achievements

  1. Set counter to zero Repeat 500 times Add one to counter <TEXTTYPE:<CTRL>c Repeat counter times <TEXTTYPE:<ENTER> Repeat end Repeat counter times <TEXTTYPE:<ARROW UP> Repeat end Repeat end Watch out for timing issues -- if the macro typing gets ahead of how fast Excel can handle it, you will not be in a happy place.😞
  2. If you suspect an invisible (usually leading or trailing) character, you can display its invisibleness (new word, invented today!) in a text box. Let's say you wonder about variable %text% which appears to contain ABC. In a text box, display >>>%text%<<<. If it really contains only ABC, the display will be >>>ABC<<<. No "white space" between the variable and the brackets. If there is a non-displayable character at beginning or end, the display will be >>> ABC<<< or >>>ABC <<<
  3. Can it be opened via keystrokes, rather than by clicking on it? Here's a Windows option I had to turn on at some point.
  4. Or, can you use the menu -- how did you get the drop-down list under Convert to display? Text type <ALT>c to open the Convert options short delay Text type f
  5. Try changing it to Text Type (Simulate Keystrokes): <ALTD>2<ALTU> Shouldn't make a difference, but I have found that sometimes it does.
  6. You could put a delay within your macro -- in your example, right before the Page Down. The Delay command can use a variable rather than a hard-coded value. Each pass through the macro, update the variable from a file or a registry value or environment variable. Write a second macro to increment the environment variable, and a third to decrement it. So while the primary macro is running, you can dynamically slow it or speed it up by manually triggering the second and third macros.
  7. Yes, still there in my version 4.9.1.1. Another command I have never used, or even noticed! I would hesitate to use it, too -- Help says, "This is a system command that will affect any window currently open or any that will subsequently be opened." Subsequently? Like, forever? Others I have never used are Shutdown, Power Off, and Reboot. It would be too bad to have a macro consisting only of one of those commands, tell the macro to run at ME startup, and tell ME to start automatically at Windows startup.
  8. So your results are different from mine with the same script. I also tried the same script starting with a full-screen window. My results were similar to a smaller window except that the positioning to 0,0, and the positioning to top-left-corner, resulted in the RIGHT margin being partially off the screen because the window was too wide for the screen. I normally run my screen at 1366 X 768, but when I changed it to the "recommended" 1920 X 1080, the macro positioning worked fine with no right-margin problem. So acantor's information about border thickness may be the answer. Or -- shocking as it may seem -- Windows 10 may still have a few bugs. 😮
  9. I can't reproduce your problem on my Windows 10 / MEX Pro 4 system, for a window that is less than full-screen. With the macro below, I can see the window shifted partially off the screen by the first move. It jumps to proper alignment, both visually and with the diagnostic display, by the second move. There is no change by the third move. // Window Reposition: <Current Window> Position: -8, -8 // Variable Set Integer %x%: Set to the Current Window's Left Variable Set Integer %y%: Set to the Current Window's Top Text Box Display: Display window position Delay: 2 seconds, without ability to halt // Window Reposition: <Current Window> Position: 0, 0 // Variable Set Integer %x%: Set to the Current Window's Left Variable Set Integer %y%: Set to the Current Window's Top Text Box Display: Display window position // Delay: 2 seconds, without ability to halt Window Reposition: <Current Window> Move to the top-left corner // Variable Set Integer %x%: Set to the Current Window's Left Variable Set Integer %y%: Set to the Current Window's Top Text Box Display: Display window position // Macro Return // <COMMENT Value=" "/> <WINDOW REPOSITION Option="\x00" Partial="TRUE" Wildcards="FALSE" Method="\x00" Left="-8" Top="-8" Monitor="0" _IGNORE="0x0006"/> <COMMENT Value=" "/> <VARIABLE SET INTEGER Option="\x09" Destination="%x%"/> <VARIABLE SET INTEGER Option="\x08" Destination="%y%"/> <TEXT BOX DISPLAY Title="Display window position" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 x = %x%\r\n\\par y = %y%\\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"/> <DELAY Flags="\x10" Time="2"/> <COMMENT Value=" "/> <WINDOW REPOSITION Option="\x00" Partial="TRUE" Wildcards="FALSE" Method="\x00" Left="0" Top="0" Monitor="0" _IGNORE="0x0006"/> <COMMENT Value=" "/> <VARIABLE SET INTEGER Option="\x09" Destination="%x%"/> <VARIABLE SET INTEGER Option="\x08" Destination="%y%"/> <TEXT BOX DISPLAY Title="Display window position" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 x = %x%\r\n\\par y = %y%\\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"/> <COMMENT Value=" "/> <DELAY Flags="\x10" Time="2"/> <WINDOW REPOSITION Option="\x00" Partial="TRUE" Wildcards="FALSE" Method="\x02" Left="0" Top="0" Monitor="0" _IGNORE="0x0006"/> <COMMENT Value=" "/> <VARIABLE SET INTEGER Option="\x09" Destination="%x%"/> <VARIABLE SET INTEGER Option="\x08" Destination="%y%"/> <TEXT BOX DISPLAY Title="Display window position" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 x = %x%\r\n\\par y = %y%\\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"/> <COMMENT Value=" "/> <MACRO RETURN/> <COMMENT Value=" "/>
  10. Not to beat a dead horse, but this was fun to try as an experiment: This macro (and a bunch more like it) works surprisingly well. Even with the logging (to prove to myself that it was running), it easily keeps up with my typing, and I'm a pretty good typist. The hotkey to start the macro is the letter "a", and the macro types the letter "a", but it could easily type a different letter. So if you have only a few keys you want to remap, this would be practical. If you want to change the whole keyboard from qwerty to Dvorak, this would be the hard way to do it. Keystroke Speed: 0 milliseconds Text Type (Simulate Keystrokes): a Log Messages to "C:\Temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt" "Macro executed: 0a" Macro Return
  11. I have "sort of remapped" a couple individual keys by using them as a hotkey to trigger a macro. The macro checks conditions and either performs its work, or simply text-types the original character, as appropriate. In other words, except in special situations the macro simply acts as a pass-through for the key that triggered the macro. I wouldn't want to remap the whole keyboard that way, though!😬
  12. Sometimes ME can dynamically build (then run) the simple line of code, or the whole batch file. That's not needed if the batch commands do exactly the same thing every time, but it is useful if the batch does the same "function" but with variable data. For example, macro 1 runs a standard directory list with output to a text file; macro 2 reads back the text, analyzes data file sizes, builds a different "copy" command batch file for each data file based on how big the file is today and whether the backup should be compressed or not; macro 3 runs the copies a few at a time to avoid overloading the server. (That's a real application, as you may have guessed.) In other words, macros can utilize the simple and efficient batch commands, while applying logic and intelligence that otherwise would be lacking.
  13. I have a macro that does it, using the Repeat with Processes command: <COMMENT Value=" "/> <COMMENT Value=" "/> <LOCK PLAYER Wait="TRUE" _ENABLED="FALSE"/> <LOG MESSAGES Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Message="Macro executed: 0_Running_Processes_Display_on_Screen" Stamp="TRUE"/> <LOG ERRORS Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Hide_Errors="FALSE"/> <COMMENT Value=" "/> <COMMENT Value="Display all running processes"/> <COMMENT Value=" "/> <COMMENT Value=".... set up CR-LF in T98"/> <VARIABLE SET TO ASCII CHAR Value="13" Destination="%T[98]%"/> <VARIABLE SET TO ASCII CHAR Value="10" Destination="%T[99]%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%T[98]%" Variable="%T[99]%" NoEmbeddedVars="FALSE"/> <COMMENT Value=" "/> <VARIABLE SET STRING Option="\x00" Destination="%T[1]%" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%T[2]%" NoEmbeddedVars="FALSE"/> <REPEAT WITH PROCESSES Destination="%T[1]%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%T[2]%" Variable="%T[1]%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%T[2]%" Variable="%T[98]%" NoEmbeddedVars="FALSE"/> <END REPEAT/> <COMMENT Value=" "/> <COMMENT Value="Process names are stacked in T2 variable, with trailing CRLF. "/> <COMMENT Value="Now split variable T2 out into an array, to be sorted. Append CRLF to each name. "/> <SPLIT STRING Source="%T[2]%" SplitChar="%T[98]%" Dest="%ProcessNames%" Index="1"/> <COMMENT Value=" "/> <COMMENT Value="Testing, make sure last three array slots are full and all slots have some value"/> <VARIABLE SET STRING Option="\x00" Destination="%ProcessNames[250]%" Value="ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%ProcessNames[300]%" Value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%ProcessNames[299]%" Value="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%ProcessNames[298]%" Value="ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <VARIABLE SET INTEGER Option="\x00" Destination="%sortindex1%" Value="1" _ENABLED="FALSE"/> <GET ARRAY LENGTH Array="%ProcessNames%" Dest="%arraylength%" _ENABLED="FALSE"/> <REPEAT UNTIL Variable="%sortindex1%" Condition="\x03" Value="%arraylength%" _ENABLED="FALSE"/> <IF VARIABLE Variable="%ProcessNames[%sortindex1%]%" Condition="\x00" IgnoreCase="FALSE" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%ProcessNames[%sortindex1%]%" Value="ZZ" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <END IF _ENABLED="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%sortindex1%" _ENABLED="FALSE"/> <END REPEAT _ENABLED="FALSE"/> <COMMENT Value=" "/> <COMMENT Value="Sort array of process names "/> <GET ARRAY LENGTH Array="%ProcessNames%" Dest="%arraylength%"/> <VARIABLE SET INTEGER Option="\x00" Destination="%sortindex1%" Value="0"/> <VARIABLE SET INTEGER Option="\x00" Destination="%sortindex2%" Value="0"/> <VARIABLE SET INTEGER Option="\x00" Destination="%sortlimit%" Value="%arraylength%"/> <VARIABLE MODIFY INTEGER Option="\x08" Destination="%sortlimit%"/> <REPEAT UNTIL Variable="%sortindex1%" Condition="\x00" Value="%sortlimit%"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%sortindex1%"/> <VARIABLE MODIFY INTEGER Option="\x00" Destination="%sortindex2%" Value1="%sortindex1%" Value2="1"/> <IF VARIABLE Variable="%ProcessNames[%sortindex1%]%" Condition="\x00" IgnoreCase="FALSE"/> <REPEAT EXIT/> <END IF/> <REPEAT UNTIL Variable="%sortindex2%" Condition="\x03" Value="%arraylength%"/> <TEXT BOX DISPLAY Title="Diagnostics -- indexes" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %sortindex1%\r\n\\par %sortindex2%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <IF VARIABLE Variable="%ProcessNames[%sortindex2%]%" Condition="\x00" IgnoreCase="FALSE"/> <REPEAT EXIT/> <END IF/> <IF VARIABLE Variable="%ProcessNames[%sortindex1%]%" Condition="\x03" Value="%ProcessNames[%sortindex2%]%" IgnoreCase="FALSE"/> <VARIABLE MODIFY STRING Option="\x08" Destination="%tempname%" Variable="%ProcessNames[%sortindex1%]%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x08" Destination="%ProcessNames[%sortindex1%]%" Variable="%ProcessNames[%sortindex2%]%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x08" Destination="%ProcessNames[%sortindex2%]%" Variable="%tempname%" NoEmbeddedVars="FALSE"/> <END IF/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%sortindex2%"/> <END REPEAT/> <END REPEAT/> <COMMENT Value=" "/> <COMMENT Value="Testing skip counting and removing duplicates *********************************************" _ENABLED="FALSE"/> <IF VARIABLE Variable="%skip%" Condition="\x01" Value="%skip%" IgnoreCase="FALSE" _ENABLED="FALSE"/> <COMMENT Value="Remove and count duplicate names from list "/> <GET ARRAY LENGTH Array="%ProcessNames%" Dest="%arraylength%"/> <VARIABLE SET INTEGER Option="\x00" Destination="%sortindex1%" Value="0"/> <VARIABLE SET INTEGER Option="\x00" Destination="%sortindex2%" Value="0"/> <VARIABLE SET INTEGER Option="\x00" Destination="%sortlimit%" Value="%arraylength%"/> <VARIABLE MODIFY INTEGER Option="\x08" Destination="%sortlimit%"/> <REPEAT UNTIL Variable="%sortindex1%" Condition="\x00" Value="%sortlimit%"/> <VARIABLE SET INTEGER Option="\x00" Destination="%dupcount%" Value="1"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%sortindex1%"/> <VARIABLE MODIFY INTEGER Option="\x00" Destination="%sortindex2%" Value1="%sortindex1%" Value2="1"/> <IF VARIABLE Variable="%ProcessNames[%sortindex1%]%" Condition="\x01" IgnoreCase="FALSE" _COMMENT="****1"/> <REPEAT UNTIL Variable="%sortindex2%" Condition="\x03" Value="%arraylength%"/> <TEXT BOX DISPLAY Title="Diagnostics -- indexes" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %sortindex1%\r\n\\par %sortindex2%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <IF VARIABLE Variable="%ProcessNames[%sortindex2%]%" Condition="\x00" IgnoreCase="FALSE" _COMMENT=" ****2"/> <OR/> <IF VARIABLE Variable="%ProcessNames[%sortindex2%]%" Condition="\x03" Value="%ProcessNames[%sortindex1%]%" IgnoreCase="FALSE"/> <IF VARIABLE Variable="%dupcount%" Condition="\x03" Value="1" IgnoreCase="FALSE" _COMMENT=" ****3"/> <VARIABLE MODIFY STRING Option="\x06" Destination="%ProcessNames[%sortindex1%]%" Value=" (" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x06" Destination="%ProcessNames[%sortindex1%]%" Value="%dupcount%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x06" Destination="%ProcessNames[%sortindex1%]%" Value=" instances)" NoEmbeddedVars="FALSE"/> <REPEAT EXIT/> <END IF _COMMENT=" ****3"/> <END IF _COMMENT=" ****2"/> <IF VARIABLE Variable="%ProcessNames[%sortindex1%]%" Condition="\x00" Value="%ProcessNames[%sortindex2%]%" IgnoreCase="FALSE" _COMMENT=" ****4"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%dupcount%"/> <VARIABLE SET STRING Option="\x00" Destination="%ProcessNames[%sortindex2%]%" NoEmbeddedVars="FALSE"/> <END IF _COMMENT=" ****4"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%sortindex2%"/> <END REPEAT/> <END IF _COMMENT=" ****1"/> <END REPEAT/> <COMMENT Value=" "/> <COMMENT Value="Testing skip counting and removing duplicates *********************************************" _ENABLED="FALSE"/> <END IF _ENABLED="FALSE"/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value="Pull process names out of array, stack into %Display% with CRLF appended to each "/> <GET ARRAY LENGTH Array="%ProcessNames%" Dest="%arraylength%"/> <VARIABLE SET INTEGER Option="\x00" Destination="%index1%" Value="0"/> <VARIABLE SET INTEGER Option="\x00" Destination="%processcounter%" Value="0"/> <VARIABLE SET STRING Option="\x00" Destination="%display%" NoEmbeddedVars="FALSE"/> <REPEAT START Start="1" Step="1" Count="%arraylength%" Save="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%index1%"/> <IF VARIABLE Variable="%ProcessNames[%index1%]%" Condition="\x01" IgnoreCase="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%processcounter%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%display%" Variable="%ProcessNames[%index1%]%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%display%" Variable="%T[98]%" NoEmbeddedVars="FALSE"/> <END IF/> <END REPEAT/> <COMMENT Value=" "/> <TEXT BOX DISPLAY Title="List of running processes" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs20 Number of processes: %processcounter%\r\n\\par \\f1 %\\f0 display\\f1 %\r\n\\par }\r\n" Left="Center" Top="Center" Width="632" Height="703" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <COMMENT Value=" "/> <COMMENT Value="Restore variables used by this macro" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x0B" Destination="%T[1]%" Value="WIN_DISPLAY_SAVE_T1" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x0B" Destination="%T[2]%" Value="WIN_DISPLAY_SAVE_T2" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x0B" Destination="%T[98]%" Value="WIN_DISPLAY_SAVE_T98" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x0B" Destination="%T[99]%" Value="WIN_DISPLAY_SAVE_T99" NoEmbeddedVars="FALSE" _ENABLED="FALSE"/> <COMMENT Value=" "/> <COMMENT Value="Done - exit"/> <MACRO RETURN/> <UNLOCK PLAYER _ENABLED="FALSE"/> `````
  14. Now and then a version of Firefox comes along that doesn't want to close. I use a .bat file as shown below, to kill and restart Firefox. There are multiple "taskkill" commands, because there tends to be more than one Firefox process running -- don't know why. The .bat file can be launched from a macro: Program Launch: "c:\menus\kill_firefox.bat" (Normal) Parameters: taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe taskkill /F /IM firefox.exe "C:\Program Files\Mozilla Firefox\firefox.exe"
×
×
  • Create New...