Jump to content
Macro Express Forums

rberq

Members
  • Posts

    989
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by rberq

  1. Same here. Usually my problem is what we would euphemistically call "operator error". 🙂
  2. Yes! I was beginning to think I was the only one to have that problem! Rather than gamble, I ALWAYS use the key-down / key-up sequence rather than rely on Macro Express to do it magically. 🙃
  3. Have you set up the forum's "Follow" option so you will be notified of activity on your threads? There were several replies to your previous posting of this question. See upper right on the page to "Follow".
  4. Ouch. You really did mean ALL the menus were dumped at once into the one bag and scrambled together. Sounds to me like a macro file corruption -- did your macro file recently get auto-converted from one ME version to the next, like from 4 to 6?
  5. I had the option set to back up whenever the Editor closed, and it was backing up every time I closed out of editing a macro. That was excessive. Changed the preference to back up when ME itself closed. That was not often enough, so now if I want a backup I do Ctrl-Alt-0 to run a macro that does a Restart ME command. Only takes a few seconds. Incidentally, with ME Pro the Restart resulted in lots of faults/abends, until I inserted a line to wait for file-ready for the log file, and removed the Macro Return command following the Restart. Help screens say that Restart should be the very last command within the macro.
  6. I use just a few small menus. ME Pro 4.9. I haven't seen any problem, but I might not even notice. A challenge sounds like fun -- I would get to reuse the bubble sort logic that I just wrote for displaying active processes. 😛
  7. I'm not familiar with Active Desktop Calendar, but usually after Alt-d to open a menu like that, you would type "e" to go to the item within the menu, rather than "Alt-e". I don't know what your Delay is needed for -- does it take a long time for the Data Menu to open?
  8. Good idea. I think the default is to let ME log to a separate file for each macro. It would be pretty easy to merge the files, import to Excel, and inter-sort the lines by date so as to see them in sequence. EXCEPT see below -- the line "Macro executed" comes from the LOG MESSAGES command -- the line "Macro Completed" comes automatically because LOG ERRORS is found within the macro. Unfortunately the time-stamp formats that ME uses for the messages is significantly different. Maybe Excel can normalize them; I'll have to look into that. 8/7/2020 5:58:59 PM: Macro executed: Temp Friday, August 07, 2020 5:58:59 PM: Macro Completed (Temp)
  9. As explained above (7/17), I've been doing this for years with never a problem, and it has great advantages for reducing clutter and for seeing the timing and sequencing among running macros. But I have always used ME3. After recently converting to ME Pro, and inactivating the Lock/Unlock Player commands from all my macros, there have been a few ME failures when (apparently) more than one macro tried to write to the log at the same time. So take heed if you want to use the log this way. I reactivated the Lock/Unlock Player commands in most of my macros. Each one assumes it is running standalone, anyhow, since with ME3 they had to be.
  10. What version of ME are you using? You said above, "... when "Variable Set String" opens, you must press Tab five times to get to the first field." Using a macro to insert commands (inspired by your other challenge), I believe I had to TAB only twice. Odd.
  11. I can see where this is useful when coding macros, and makes for one less irritation. I do little enough development these days that the irritation is good to keep me alert. What I never thought about before, however, is that every command window appears focused with its own name and therefore can trigger a macro to run. I will keep that in mind for the future -- it could be handy for tasks other than ironing out inconsistencies. As usual with your challenges, I learned something new even if I didn't write a macro.
  12. So, I finally got around to your suggestion for automating insertion of commands. The more I thought about it, the more I agreed with you that it could save a lot of time. Instead of using separate hot keys for each inserted command, I used a single hot key to start the “insert” macro. The macro displays a menu of commands to be inserted, with the ampersand (&) to make each menu item keyboard-selectable. There is more code for most commands to select generic options, so what is inserted is really a “dummy” command that must be modified afterwards. For example, the inserted “Variable Set String” sets a dummy variable to null. In addition, certain menu selections insert multiple dummy commands: selecting “Repeat Start” results in a skeleton loop: Repeat Start Repeat Exit End Repeat Selecting “If Variable” results in a skeleton If %T[99]% Equals “” Else End If // Log Messages to "C:\Temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt" "Macro executed: 2x_Insert_Common_Macro_Commands" Log Errors to "C:\Temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt" Keystroke Speed: 30 milliseconds Mouse Speed: 30 milliseconds // // Macro displays a multiple-choice box, inserts selected command into macro // If Not Window "Macro Express Pro - Script Editor" is focused Macro Return End If // // Multiple-choice box Multiple Choice Menu: Command List Variable Modify String: Replace "&" in %command% with "" If Variable %command% Equals "" // On null selection, end macro OR If Variable %command% Equals "X - Exit, No Command" // On null selection, end macro Macro Return End If // // Prepare command panel to insert the chosen instruction Text Type (Simulate Keystrokes): <ALTD><ARROW DOWN><ALTU> // Alt-DownArrow to move to "Search for command" field // Select the chosen command from the list Text Type (Simulate Keystrokes): %command% Text Type (Simulate Keystrokes): <ENTER> // ENTER to insert the command // // For some commands, do extra keystrokes and/or inserts If Variable %command% Equals "Comment" // COMMENT Text Type (Simulate Keystrokes): <SPACE><TAB><ENTER> // One blank space and ENTER to insert the comment End If // If Variable %command% Equals "Delay" // DELAY Text Type (Simulate Keystrokes): <ARROW DOWN><TAB>250<TAB><TAB><SPACE><TAB><ENTER> // Set 250ms, ignore macro speed factor, ENTER command End If // If Variable %command% Equals "If Variable" // IF VARIABLE For If Variable, also enter Else and End If Delay: 250 milliseconds Text Type (Simulate Keystrokes): <TAB><TAB>%T[99]<TAB><TAB><TAB><TAB><TAB><ENTER> // ENTER to insert the command Delay: 250 milliseconds Text Type (Simulate Keystrokes): <ALTD><ARROW DOWN><ALTU> Text Type (Simulate Keystrokes): Else Text Type (Simulate Keystrokes): <ENTER> // ENTER to insert the command Delay: 250 milliseconds Text Type (Simulate Keystrokes): <ALTD><ARROW DOWN><ALTU> Text Type (Simulate Keystrokes): End If Text Type (Simulate Keystrokes): <ENTER> // ENTER to insert the command End If // If Variable %command% Equals "Mouse Move" // MOUSE MOVE Text Type (Simulate Keystrokes): <TAB><TAB><TAB><TAB><TAB><TAB><ENTER> // Set 250ms, ignore macro speed factor, ENTER command End If // If Variable %command% Equals "Repeat Start" // REPEAT START For Repeat Start, also enter a Repeat Exit and End Repeat Text Type (Simulate Keystrokes): <ENTER> // ENTER to insert the command Delay: 250 milliseconds Text Type (Simulate Keystrokes): <ALTD><ARROW DOWN><ALTU> Text Type (Simulate Keystrokes): Repeat Exit Text Type (Simulate Keystrokes): <ENTER> // ENTER to insert the command Delay: 250 milliseconds Text Type (Simulate Keystrokes): <ALTD><ARROW DOWN><ALTU> Text Type (Simulate Keystrokes): End Repeat Text Type (Simulate Keystrokes): <ENTER> // ENTER to insert the command End If // If Variable %command% Equals "Text Type" // TEXT TYPE Macro Return End If // If Variable %command% Equals "Text Box Display" // TEXT BOX DISPLAY Macro Return End If // If Variable %command% Equals "Variable Set String" // VARIABLE SET STRING Delay: 250 milliseconds Text Type (Simulate Keystrokes): <TAB><TAB> Variable Set String %T[99]% to "%T[99]%" Text Type (Simulate Keystrokes): %T[99]% Text Type (Simulate Keystrokes): <TAB><TAB><TAB><TAB><ENTER> End If // If Variable %command% Equals "Variable Modify String" // VARIABLE MODIFY STRING Delay: 250 milliseconds Text Type (Simulate Keystrokes): <TAB><TAB> Variable Set String %T[99]% to "%T[99]%" Text Type (Simulate Keystrokes): %T[99]% Text Type (Simulate Keystrokes): <TAB><TAB><ENTER> End If // // // Macro Return // //////////////////////////////////////////////////////////// <COMMENT Value=" "/> <LOG MESSAGES Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Message="Macro executed: 2x_Insert_Common_Macro_Commands" Stamp="TRUE"/> <LOG ERRORS Filename="C:\\Temp\\MacroExpressProLogFiles\\MacroExpressPro_Macro_Log_File.txt" Hide_Errors="FALSE"/> <KEYSTROKE SPEED Delay="30"/> <MOUSE SPEED Delay="30"/> <COMMENT Value=" "/> <COMMENT Value="Macro displays a multiple-choice box, inserts selected command into macro"/> <COMMENT Value=" "/> <IF NOT WINDOW Option="\x00" Title="Macro Express Pro - Script Editor" Partial="TRUE" Wildcards="FALSE"/> <MACRO RETURN/> <END IF/> <COMMENT Value=" "/> <COMMENT Value="Multiple-choice box"/> <MULTIPLE CHOICE MENU Style="\x00" Result="\x01" Dest="%command%" Title="Command List" Prompt=" Choose command to insert" Options="&Comment\r\n&Delay\r\n&If Variable\r\nMacro R&eturn\r\n&Mouse Move\r\nMouse &Left Click\r\n&Repeat Start\r\n&Text Type\r\nText &Box Display\r\nVariable Set &String\r\nVariable M&odify String\r\n&X - Exit, No Command" Left="Center" Top="Center" Monitor="0" Width="443" Height="226" OnTop="FALSE" Columns="Auto"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%command%" ToReplace="&" All="TRUE" IgnoreCase="FALSE" NoEmbeddedVars="FALSE"/> <IF VARIABLE Variable="%command%" Condition="\x00" IgnoreCase="FALSE" _COMMENT="On null selection, end macro\r\n"/> <OR/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="X - Exit, No Command" IgnoreCase="FALSE" _COMMENT="On null selection, end macro\r\n"/> <MACRO RETURN/> <END IF/> <COMMENT Value=" "/> <COMMENT Value="Prepare command panel to insert the chosen instruction"/> <TEXT TYPE Action="0" Text="<ALTD><ARROW DOWN><ALTU>" _COMMENT="Alt-DownArrow to move to \"Search for command\" field"/> <COMMENT Value="Select the chosen command from the list"/> <TEXT TYPE Action="0" Text="%command%"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="ENTER to insert the command"/> <COMMENT Value=" "/> <COMMENT Value="For some commands, do extra keystrokes and/or inserts"/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Comment" IgnoreCase="FALSE" _COMMENT="COMMENT"/> <TEXT TYPE Action="0" Text="<SPACE><TAB><ENTER>" _COMMENT="One blank space and ENTER to insert the comment"/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Delay" IgnoreCase="FALSE" _COMMENT="DELAY"/> <TEXT TYPE Action="0" Text="<ARROW DOWN><TAB>250<TAB><TAB><SPACE><TAB><ENTER>" _COMMENT="Set 250ms, ignore macro speed factor, ENTER command"/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="If Variable" IgnoreCase="FALSE" _COMMENT="IF VARIABLE For If Variable, also enter Else and End If"/> <DELAY Flags="\x12" Time="250"/> <TEXT TYPE Action="0" Text="<TAB><TAB>%T[99]<TAB><TAB><TAB><TAB><TAB><ENTER>" _COMMENT="ENTER to insert the command"/> <DELAY Flags="\x12" Time="250"/> <TEXT TYPE Action="0" Text="<ALTD><ARROW DOWN><ALTU>"/> <TEXT TYPE Action="0" Text="Else"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="ENTER to insert the command"/> <DELAY Flags="\x12" Time="250"/> <TEXT TYPE Action="0" Text="<ALTD><ARROW DOWN><ALTU>"/> <TEXT TYPE Action="0" Text="End If"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="ENTER to insert the command"/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Mouse Move" IgnoreCase="FALSE" _COMMENT="MOUSE MOVE"/> <TEXT TYPE Action="0" Text="<TAB><TAB><TAB><TAB><TAB><TAB><ENTER>" _COMMENT="Set 250ms, ignore macro speed factor, ENTER command"/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Repeat Start" IgnoreCase="FALSE" _COMMENT="REPEAT START For Repeat Start, also enter a Repeat Exit and End Repeat"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="ENTER to insert the command"/> <DELAY Flags="\x12" Time="250"/> <TEXT TYPE Action="0" Text="<ALTD><ARROW DOWN><ALTU>"/> <TEXT TYPE Action="0" Text="Repeat Exit"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="ENTER to insert the command"/> <DELAY Flags="\x12" Time="250"/> <TEXT TYPE Action="0" Text="<ALTD><ARROW DOWN><ALTU>"/> <TEXT TYPE Action="0" Text="End Repeat"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="ENTER to insert the command"/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Text Type" IgnoreCase="FALSE" _COMMENT="TEXT TYPE"/> <MACRO RETURN/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Text Box Display" IgnoreCase="FALSE" _COMMENT="TEXT BOX DISPLAY"/> <MACRO RETURN/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Variable Set String" IgnoreCase="FALSE" _COMMENT="VARIABLE SET STRING"/> <DELAY Flags="\x12" Time="250"/> <TEXT TYPE Action="0" Text="<TAB><TAB>"/> <VARIABLE SET STRING Option="\x00" Destination="%T[99]%" Value="%T[99]%" NoEmbeddedVars="TRUE"/> <TEXT TYPE Action="0" Text="%T[99]%"/> <TEXT TYPE Action="0" Text="<TAB><TAB><TAB><TAB><ENTER>"/> <END IF/> <COMMENT Value=" "/> <IF VARIABLE Variable="%command%" Condition="\x00" Value="Variable Modify String" IgnoreCase="FALSE" _COMMENT="VARIABLE MODIFY STRING"/> <DELAY Flags="\x12" Time="250"/> <TEXT TYPE Action="0" Text="<TAB><TAB>"/> <VARIABLE SET STRING Option="\x00" Destination="%T[99]%" Value="%T[99]%" NoEmbeddedVars="TRUE"/> <TEXT TYPE Action="0" Text="%T[99]%"/> <TEXT TYPE Action="0" Text="<TAB><TAB><ENTER>"/> <END IF/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value=" "/> <MACRO RETURN/> <COMMENT Value=" "/>
  13. If you come up with something for Gmail, let us know. I had a great macro that handled the list of emails on the Inbox screen to identify and delete duplicates. Gmail changed some time ago so the macro is now useless.
  14. I discovered that just yesterday when trying to use controls to click on a button. 😧 I have scripts for some web sites where a button or image appears, and maybe also changes color when the mouse hovers over it, once the page has loaded. Since I know where the button will be, I put the mouse there and keep checking the color until it gets to what I want. I also use Cory's method of examining the URL -- I didn't know F6 would highlight it, I have been using Alt-d. Also for some pages it works to click within the page, Ctrl-a to highlight everything and copy to clipboard, and look for identifying text. Typing END or clicking the mouse again usually clears the highlighting.
  15. Good idea to make the Direct Editor the default -- that would save a little time for each scan. Is that an ME 6 option? -- can't find it in ME 4. I wrote a driver for the scan macro and ran it on 33 macros. Nice round number. It took slightly over a minute in all. Screens flash by too fast for me to read much. Variable Set Integer %count% to 33 Repeat Start (Repeat %count% times) Macro Run: 9a_Search_Macros_for_Macro_Run_Commands End Repeat I also was not aware that Export could put out a text file. That file could probably be imported into an Excel spreadsheet, add a column to sequentially number each line from one to umpteen, sort to put all "Name:" lines together and all "Macro run" lines together, delete everything else, re-sort on the sequence column, and voila.
  16. So I wrote this macro anyway, to get practice working with ME Pro instead of ME 3. I had a few hours of frustrating failure with what I knew to be FAULTLESS code (the kind I always write🙄), until I figured out what it means to process or not process embedded variables. This macro scans a macro selected from the Macro Explorer and reports main macro name and macros called from within the main macro. It does this by copying the Direct Editor code into a variable, then analyzing that. It only scans one macro, then quits, but before it quits it advances to the next in the Explorer list. Therefore it should work well with a “driver” macro that simply calls the scanner 10 times in succession, or 100 times, or 1,000 …. See additional documentation in comment statements near the beginning of the macro text. I STRONGLY recommend running this against a copy of your live macro file, not against the “real” one. In theory, it makes no changes to any macro. But I hate to turn loose a process intended to interact, at very high speed, with hundreds of valuable macros – if something goes awry, who knows what damage might be caused. I’m going to look into Cory’s “export” technique; probably faster than running in the Explorer and Editor, but I assume parsing out the commands would be much the same. Lock Player: Wait for running macros to stop Log Errors to "C:\Temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt" Log Messages to "C:\Temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt" "Macro executed: TempRunCommandSearch" Log Errors to Default Macro Log // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Keystroke Speed: 10 milliseconds Mouse Speed: 30 milliseconds // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // // MACRO TO FIND "MACRO RUN" COMMANDS WITHIN A "MAIN" MACRO // // This macro was written and tested with Macro Express Pro (ME version 4). // This macro scans macro text to find MACRO RUN commands. // An output report (text) file is written containing the name of the main (scanned) // macro, followed by the names of all called macros. // If the main macro does no calls, then its name is not written to the report. // If a macro is called multiple times by the main macro, its name is listed only once. // Processing should begin with Macro Explorer open, and the macro to be scanned // should be highlighted (selected). // This macro: // 1) Opens the main macro in the Macro Editor and extracts the name (nickname). // 2) Switches to the Direct editor. // 3) Copies the Direct editor script to the clipboard and then to a text variable. // 4) Closes Macro Editor and arrows down to the next macro line within Explorer. // 5) Parses the copied script to extract names from MACRO RUN commands, writes report. // This macro is best run by a second "driver" macro that activates it multiple times. // Because it processes the macro selected in Explorer, then selects the subsequent // macro, a large number of scripts may be scanned by one start of the "driver" macro. // For safety, this macro should be run against a temporary test copy of the macro file, // not against a live macro file. // // For testing, delete the output text file if it exists Delete File/Files: "c:\temp\test_called_macros.txt" // Type ENTER in Macro Explorer to open highlighted macro in Editor Text Type (Simulate Keystrokes): <ENTER> // Wait for Editor to open Repeat Until %dummy% Does not Equal "%dummy%" If Window "Macro Express Pro - Script Editor" is focused Repeat Exit Else Delay: 100 milliseconds End If End Repeat // Alt-n to go to macro nickname field Text Type (Simulate Keystrokes): <ALTD>n<ALTU> // Highlight macro nickname and copy to clipboard, then to variable mainmac, then END to release the highlighting Text Type (Simulate Keystrokes): <SHIFTD><END><SHIFTU> Macro Run: 0_Generic_Copy_To_Clipboard Variable Set String %mainmac% from the clipboard contents Text Type (Simulate Keystrokes): <END> Text Box Display: Diagnostics // Alt-i to get to script tab, then Alt-v (View) and letter i for Direct Editor Text Type (Simulate Keystrokes): <ALTD>i<ALTU> Text Type (Simulate Keystrokes): <ALTD>v<ALTU>i Delay: 1000 milliseconds // At this point the main macro should be visible in the Direct Editor // Ctrl-a to highlight the entire macro script, copy to clipboard then to %maintext% variable, type END to clear the highlighting Text Type (Simulate Keystrokes): <CTRLD>a<CTRLU> Delay: 1000 milliseconds Macro Run: 0_Generic_Copy_To_Clipboard Variable Set String %maintext% from the clipboard contents Text Type (Simulate Keystrokes): <END> Text Box Display: Diagnostics // Close Macro Editor. FROM HERE ON WE WILL WORK WITH VARIABLES, NOT IN THE MACRO EDITOR. Text Type (Simulate Keystrokes): <ALTD>s<ALTU>c // Wait until Editor is closed and Macro Explorer is focused Repeat Until %dummy% Does not Equal "%dummy%" If Window "Macro Express Pro - Explorer" is focused Repeat Exit Else Delay: 100 milliseconds End If End Repeat Text Box Display: Diagnostics // In Macro Explorer, arrow down to the next macro so we will be ready to process it Text Type (Simulate Keystrokes): <ARROW DOWN> Delay: 1000 milliseconds // // // Clear working variables: %called_list% for all called macros found within this main macro. %display% for lines to be written to the output text file. Variable Set String %called_list% to "" Variable Set String %display% to "" // Clean up the macro script by stripping CR/LF and removing % symbols Variable Modify String %maintext%: Strip CR/LF Variable Modify String: Replace "%" in %maintext% with "" // If macro text contains a Macro Run command, send the main macro name to the output file // If no Macro Run command within this macro, exit from this macro. If Variable %maintext% Contains "<MACRO RUN Use_ID="" Variable Set String %display% to " " // blank line to separate report for each scanned macro Variable Modify String: Append %display% to text file, "c:\temp\test_called_macros.txt" Variable Set String %display% to "Main macro: " Variable Modify String %display%: Append Text String Variable (%mainmac%) Variable Modify String: Append %display% to text file, "c:\temp\test_called_macros.txt" Else Macro Return End If // Entire macro script is in variable %maintext%. Extract and list each unique macro name found within a MACRO RUN command. Repeat Until %maintext% Does not Contain "<MACRO RUN Use_ID="" // Variable Set Integer %offset% to the position of "<MACRO RUN Use_ID="" in %maintext% // find MACRO RUN command within macro script If Variable %offset% Does not Equal "0" Variable Modify Integer: %offset% = %offset% + 18 Text Box Display: Diagnostics Macro Return Variable Modify String %maintext%: Delete a substring starting at 1 and %offset% characters long // delete all macro script up through MACRO RUN ... text Text Box Display: Diagnostics deleted up through MACRO RUN Else Text Box Display: Error Macro Return End If // Variable Set Integer %offset% to the position of "name="" in %maintext% // find "name= within remaining macro script If Variable %offset% Does not Equal "0" Variable Modify Integer: %offset% = %offset% + 5 Variable Modify String %maintext%: Delete a substring starting at 1 and %offset% characters long // delete all macro script up to and including "name=" Text Box Display: Diagnostics deleted up through name= Else Text Box Display: Error Macro Return End If // Variable Set Integer %offset% to the position of """ in %maintext% // find quotation mark terminating the name of the called macro within the MACRO RUN command If Variable %offset% Does not Equal "0" Variable Modify Integer %offset%: Decrement Variable Modify String: Copy a substring in %maintext%, starting at 1 and %offset% characters long to %called_name% // extract the called macro name from the Macro Run command Text Box Display: Diagnostics Else Text Box Display: Error Macro Return End If // If name of called macro is not already in "called_list", put it there and send name to output text file // If the called macro name has already been found (is in called_list), bypass it so output file won't contain duplicates // Add "xxxxxxxxxx" to the name inserted in "called_list", so subsets of the name won't be confused with the full name. Variable Modify String %extended_called_name%: Copy Whole Text (%called_name%) Variable Modify String %extended_called_name%: Append Text (xxxxxxxxxx) Text Box Display: Diagnostics before filling called_list If Variable %called_list% Does not Contain "%extended_called_name%" Text Box Display: Diagnostics is called name in list? Variable Modify String %called_list%: Append Text String Variable (%extended_called_name%) Text Box Display: Diagnostics after filling called_list Variable Set String %display% to "Called macro: " Variable Modify String %display%: Append Text String Variable (%called_name%) Variable Modify String: Append %display% to text file, "c:\temp\test_called_macros.txt" End If // End Repeat // Text Box Display: Diagnostics // // // // // // // Macro Return // Unlock Player <LOCK PLAYER Wait="TRUE"/> <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: TempRunCommandSearch" Stamp="TRUE"/> <LOG ERRORS Hide_Errors="FALSE" _ENABLED="FALSE"/> <COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/> <KEYSTROKE SPEED Delay="10"/> <MOUSE SPEED Delay="30"/> <COMMENT Value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/> <COMMENT Value=" "/> <COMMENT Value="MACRO TO FIND \"MACRO RUN\" COMMANDS WITHIN A \"MAIN\" MACRO "/> <COMMENT Value=" "/> <COMMENT Value="This macro was written and tested with Macro Express Pro (ME version 4). "/> <COMMENT Value="This macro scans macro text to find MACRO RUN commands."/> <COMMENT Value="An output report (text) file is written containing the name of the main (scanned)"/> <COMMENT Value="macro, followed by the names of all called macros."/> <COMMENT Value="If the main macro does no calls, then its name is not written to the report."/> <COMMENT Value="If a macro is called multiple times by the main macro, its name is listed only once."/> <COMMENT Value="Processing should begin with Macro Explorer open, and the macro to be scanned"/> <COMMENT Value="should be highlighted (selected). "/> <COMMENT Value="This macro:"/> <COMMENT Value="1) Opens the main macro in the Macro Editor and extracts the name (nickname)."/> <COMMENT Value="2) Switches to the Direct editor."/> <COMMENT Value="3) Copies the Direct editor script to the clipboard and then to a text variable."/> <COMMENT Value="4) Closes Macro Editor and arrows down to the next macro line within Explorer."/> <COMMENT Value="5) Parses the copied script to extract names from MACRO RUN commands, writes report. "/> <COMMENT Value="This macro is best run by a second \"driver\" macro that activates it multiple times. "/> <COMMENT Value="Because it processes the macro selected in Explorer, then selects the subsequent "/> <COMMENT Value="macro, a large number of scripts may be scanned by one start of the \"driver\" macro. "/> <COMMENT Value="For safety, this macro should be run against a temporary test copy of the macro file, "/> <COMMENT Value="not against a live macro file. "/> <COMMENT Value=" "/> <COMMENT Value="For testing, delete the output text file if it exists "/> <DELETE FILE/FILES Path="c:\\temp\\test_called_macros.txt" Progress="FALSE" Recurse="FALSE" Permanent="TRUE" _ENABLED="FALSE"/> <COMMENT Value="Type ENTER in Macro Explorer to open highlighted macro in Editor "/> <TEXT TYPE Action="0" Text="<ENTER>"/> <COMMENT Value="Wait for Editor to open "/> <REPEAT UNTIL Variable="%dummy%" Condition="\x01" Value="%dummy%"/> <IF WINDOW Option="\x00" Title="Macro Express Pro - Script Editor" Partial="TRUE" Wildcards="FALSE"/> <REPEAT EXIT/> <ELSE/> <DELAY Flags="\x12" Time="100"/> <END IF/> <END REPEAT/> <COMMENT Value="Alt-n to go to macro nickname field "/> <TEXT TYPE Action="0" Text="<ALTD>n<ALTU>"/> <COMMENT Value="Highlight macro nickname and copy to clipboard, then to variable mainmac, then END to release the highlighting "/> <TEXT TYPE Action="0" Text="<SHIFTD><END><SHIFTU>"/> <MACRO RUN Use_ID="FALSE" Name="0_Generic_Copy_To_Clipboard" ID="-1" Wait="TRUE"/> <VARIABLE SET STRING Option="\x02" Destination="%mainmac%" NoEmbeddedVars="FALSE"/> <TEXT TYPE Action="0" Text="<END>"/> <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 mainmac = %mainmac%\\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="Alt-i to get to script tab, then Alt-v (View) and letter i for Direct Editor "/> <TEXT TYPE Action="0" Text="<ALTD>i<ALTU>"/> <TEXT TYPE Action="0" Text="<ALTD>v<ALTU>i"/> <DELAY Flags="\x12" Time="1000" _ENABLED="FALSE"/> <COMMENT Value="At this point the main macro should be visible in the Direct Editor "/> <COMMENT Value="Ctrl-a to highlight the entire macro script, copy to clipboard then to %maintext% variable, type END to clear the highlighting"/> <TEXT TYPE Action="0" Text="<CTRLD>a<CTRLU>"/> <DELAY Flags="\x12" Time="1000" _ENABLED="FALSE"/> <MACRO RUN Use_ID="FALSE" Name="0_Generic_Copy_To_Clipboard" ID="-1" Wait="TRUE"/> <VARIABLE SET STRING Option="\x02" Destination="%maintext%" NoEmbeddedVars="FALSE"/> <TEXT TYPE Action="0" Text="<END>"/> <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 maintext = %maintext%\\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"/> <COMMENT Value="Close Macro Editor. FROM HERE ON WE WILL WORK WITH VARIABLES, NOT IN THE MACRO EDITOR."/> <TEXT TYPE Action="0" Text="<ALTD>s<ALTU>c"/> <COMMENT Value="Wait until Editor is closed and Macro Explorer is focused"/> <REPEAT UNTIL Variable="%dummy%" Condition="\x01" Value="%dummy%"/> <IF WINDOW Option="\x00" Title="Macro Express Pro - Explorer" Partial="TRUE" Wildcards="FALSE"/> <REPEAT EXIT/> <ELSE/> <DELAY Flags="\x12" Time="100"/> <END IF/> <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 ME Editor has been closed and Explorer is in focus\\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"/> <COMMENT Value="In Macro Explorer, arrow down to the next macro so we will be ready to process it "/> <TEXT TYPE Action="0" Text="<ARROW DOWN>"/> <DELAY Flags="\x12" Time="1000" _ENABLED="FALSE"/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value="Clear working variables:\r\n%called_list% for all called macros found within this main macro.\r\n%display% for lines to be written to the output text file."/> <VARIABLE SET STRING Option="\x00" Destination="%called_list%" NoEmbeddedVars="TRUE"/> <VARIABLE SET STRING Option="\x00" Destination="%display%" NoEmbeddedVars="TRUE"/> <COMMENT Value="Clean up the macro script by stripping CR/LF and removing % symbols"/> <VARIABLE MODIFY STRING Option="\x03" Destination="%maintext%" _ENABLED="FALSE"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%maintext%" ToReplace="%" All="TRUE" IgnoreCase="TRUE" NoEmbeddedVars="TRUE"/> <COMMENT Value="If macro text contains a Macro Run command, send the main macro name to the output file "/> <COMMENT Value="If no Macro Run command within this macro, exit from this macro."/> <IF VARIABLE Variable="%maintext%" Condition="\x06" Value="<MACRO RUN Use_ID=\"" IgnoreCase="TRUE"/> <VARIABLE SET STRING Option="\x00" Destination="%display%" Value=" " NoEmbeddedVars="FALSE" _COMMENT="blank line to separate report for each scanned macro"/> <VARIABLE MODIFY STRING Option="\x12" Destination="%display%" Filename="c:\\temp\\test_called_macros.txt" Strip="TRUE" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%display%" Value="Main macro: " NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%display%" Variable="%mainmac%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x12" Destination="%display%" Filename="c:\\temp\\test_called_macros.txt" Strip="TRUE" NoEmbeddedVars="FALSE"/> <ELSE/> <MACRO RETURN/> <END IF/> <COMMENT Value="Entire macro script is in variable %maintext%. Extract and list each unique macro name found within a MACRO RUN command. "/> <REPEAT UNTIL Variable="%maintext%" Condition="\x07" Value="<MACRO RUN Use_ID=\""/> <COMMENT Value=" "/> <VARIABLE SET INTEGER Option="\x0E" Destination="%offset%" Text_Variable="%maintext%" Text="<MACRO RUN Use_ID=\"" Ignore_Case="TRUE" _COMMENT="find MACRO RUN command within macro script"/> <IF VARIABLE Variable="%offset%" Condition="\x01" Value="0" IgnoreCase="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x00" Destination="%offset%" Value1="%offset%" Value2="18"/> <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 offset=%offset%\r\n\\par maintext=%maintext%\\f1 \r\n\\par }\r\n" Left="10" Top="136" Width="1296" Height="544" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="5" _ENABLED="FALSE"/> <MACRO RETURN _ENABLED="FALSE"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%maintext%" Start="1" Count="%offset%" _COMMENT="delete all macro script up through MACRO RUN ... text"/> <TEXT BOX DISPLAY Title="Diagnostics deleted up through MACRO RUN" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 offset=%offset%\r\n\\par maintext=%maintext%\\f1 \r\n\\par }\r\n" Left="10" Top="136" Width="1296" Height="544" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <ELSE/> <TEXT BOX DISPLAY Title="Error" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Error parsing \"Macro Run\" command -- macro aborted.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="457" Height="168" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO RETURN/> <END IF/> <COMMENT Value=" "/> <VARIABLE SET INTEGER Option="\x0E" Destination="%offset%" Text_Variable="%maintext%" Text="name=\"" Ignore_Case="TRUE" _COMMENT="find \"name= within remaining macro script"/> <IF VARIABLE Variable="%offset%" Condition="\x01" Value="0" IgnoreCase="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x00" Destination="%offset%" Value1="%offset%" Value2="5"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%maintext%" Start="1" Count="%offset%" _COMMENT="delete all macro script up to and including \"name=\""/> <TEXT BOX DISPLAY Title="Diagnostics deleted up through name=" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 offset=%offset%\r\n\\par maintext=%maintext%\\f1 \r\n\\par }\r\n" Left="10" Top="136" Width="1296" Height="544" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <ELSE/> <TEXT BOX DISPLAY Title="Error" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Error parsing called-macro name within \"Macro Run\" command -- macro aborted.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="551" Height="168" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO RETURN/> <END IF/> <COMMENT Value=" "/> <VARIABLE SET INTEGER Option="\x0E" Destination="%offset%" Text_Variable="%maintext%" Text="\"" Ignore_Case="TRUE" _COMMENT="find quotation mark terminating the name of the called macro within the MACRO RUN command"/> <IF VARIABLE Variable="%offset%" Condition="\x01" Value="0" IgnoreCase="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x08" Destination="%offset%"/> <VARIABLE MODIFY STRING Option="\x09" Destination="%called_name%" Variable="%maintext%" Start="1" Count="%offset%" NoEmbeddedVars="TRUE" _COMMENT="extract the called macro name from the Macro Run command"/> <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 called macro name=%called_name%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="907" Height="184" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <ELSE/> <TEXT BOX DISPLAY Title="Error" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Error parsing called-macro name within \"Macro Run\" command -- macro aborted.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="551" Height="168" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO RETURN/> <END IF/> <COMMENT Value="If name of called macro is not already in \"called_list\", put it there and send name to output text file"/> <COMMENT Value="If the called macro name has already been found (is in called_list), bypass it so output file won't contain duplicates"/> <COMMENT Value="Add \"xxxxxxxxxx\" to the name inserted in \"called_list\", so subsets of the name won't be confused with the full name."/> <VARIABLE MODIFY STRING Option="\x08" Destination="%extended_called_name%" Variable="%called_name%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x06" Destination="%extended_called_name%" Value="xxxxxxxxxx" NoEmbeddedVars="FALSE"/> <TEXT BOX DISPLAY Title="Diagnostics before filling called_list" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 called_name=%called_name%\r\n\\par extended_called_name=%extended_called_name%\r\n\\par called_list=%called_list%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="1245" Height="505" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <IF VARIABLE Variable="%called_list%" Condition="\x07" Value="%extended_called_name%" IgnoreCase="TRUE"/> <TEXT BOX DISPLAY Title="Diagnostics is called name in list?" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Called name %extended_called_name% \r\n\\par is not in list %called_list%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="1245" Height="505" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%called_list%" Variable="%extended_called_name%" NoEmbeddedVars="FALSE"/> <TEXT BOX DISPLAY Title="Diagnostics after filling called_list" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 called_name=%called_name%\r\n\\par extended_called_name=%extended_called_name%\r\n\\par called_list=%called_list%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="1245" Height="505" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%display%" Value="Called macro: " NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%display%" Variable="%called_name%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x12" Destination="%display%" Filename="c:\\temp\\test_called_macros.txt" Strip="TRUE" NoEmbeddedVars="FALSE"/> <END IF/> <COMMENT Value=" "/> <END REPEAT/> <COMMENT Value=" "/> <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 called_list=%called_list%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="1245" Height="505" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value=" "/> <COMMENT Value=" "/> <MACRO RETURN/> <COMMENT Value=" "/> <UNLOCK PLAYER/>
  17. Alternative to the logging method above: Write a macro to step through Macro Explorer, opening each macro and looking for "Macro Run" commands and appending them to a text file. At your leisure you can look at the text file to see the called macros that are not to be deleted.
  18. I have these two commands at the beginning of every macro. (I wrote a macro to put them there.) The result is a single log file, rather than a separate log for each macro. Because "Log Messages" explicitly logs each macro, called macros are just as easy to identify as main macros. The single log is especially useful for complicated applications where you want to see the sequence and timing that related macros ran. Also, for trace and/or diagnostic purposes you can scatter "Log Messages" commands throughout your macro and examine them later at your leisure. I generally inactivate the diagnostic logging after a macro is debugged, but leave the commands in place so they are easy to reactivate if later problems appear. A very short sample of my log is below. Macro Express inserts the "Macro Completed" lines, so between that and the "Log Messages" at the beginning you know when and for how long a macro ran. Notice in the last log sample that "0_Generic_Copy_To_Clipboard" is a called macro; it's beginning is indicated by the explicit "Log Messages" command within the macro, but Macro Express does NOT tell us when it ended, same as macro explorer says last run time was "Never." If you needed to know how long the called macro took to run, you could put your own time-stamped "Log Messages" command at the end of it. Commands: Log Messages to "C:\Temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt" "Macro executed: 0_Generic_Copy_To_Clipboard" Log Errors to "C:\Temp\MacroExpressProLogFiles\MacroExpressPro_Macro_Log_File.txt" 7/16/2020 12:32:41 PM: Macro executed: Kybd_Paste_Solitaire_Hint Thursday, July 16, 2020 12:32:42 PM: Macro Completed (Kybd_Paste_Solitaire_Hint) 7/16/2020 12:33:18 PM: Macro executed: 1_Type_gmail_eMail_Address Thursday, July 16, 2020 12:33:19 PM: Macro Completed (1_Type_gmail_eMail_Address) 7/16/2020 12:34:26 PM: Macro executed: 1_Close_Application_or_Browser_Window Thursday, July 16, 2020 12:34:26 PM: Macro Completed (1_Close_Application_or_Browser_Window) 7/16/2020 12:34:27 PM: Macro executed: 1_Close_Application_or_Browser_Window Thursday, July 16, 2020 12:34:27 PM: Macro Completed (1_Close_Application_or_Browser_Window) 7/16/2020 12:36:12 PM: Macro executed: 1_GoToForumLink_or_eMail 7/16/2020 12:36:12 PM: Macro executed: 0_Generic_Copy_To_Clipboard Thursday, July 16, 2020 12:36:13 PM: Macro Completed (1_GoToForumLink_or_eMail)
  19. I did modify my book-marking macro to insert a comment via the command list panel. It's nice knowing how to navigate the list with just keystrokes. Also finally wrote a macro that does nothing but simulate the DELETE key. It's either my keyboard or my clumsy fingers, but frequently when I try to delete something, it ends up deleting twice.
  20. Here are my solutions to the copy-and-paste I described above: (1) Insert a "bookmark" comment into the script. (2) For a highlighted block of code, copy to clipboard, re-find the bookmark, delete it, and in its place paste from the clipboard. The bookmark is inserted by duplicating the command at the insertion point, and adding a "bookmark" comment to the duplicated command. This is a little bit crude, because if the bookmark doesn't get deleted we end up with a duplicated command which might or might not cause problems. I might rewrite it to use your command-panel navigation method, to insert a standalone comment rather than modify a "live" command. I couldn't quite figure out that navigation when I originally worked on this a few days ago. // Macro bookmarks a place in the script by duplicating the current line and adding a "BOOKMARK" comment to it // (Works only if the Editor is set to insert commands AFTER the current command) // // Duplicate the line of code at the insertion point Text Type (Simulate Keystrokes): <CTRLD>d<CTRLU> // Ctrl-Alt-c shortcut to insert comment Text Type (Simulate Keystrokes): <CTRLD><ALTD>c<ALTU><CTRLU> Delay: 250 milliseconds // Type special recognizable "bookmark" text, then tab to "OK" and press ENTER to insert the bookmark comment Text Type (Use Clipboard and Paste Text): !@#$%*** BOOKMARK ***!@#$% Text Type (Simulate Keystrokes): <TAB><ENTER> // Macro Return // Macro copies highlighted macro script lines, pastes them into bookmarked location in script // Macro Run: 0_Generic_Copy_To_Clipboard // // Ctlr-HOME to top of script, locate bookmark, paste copied text, arrow up to bookmark line, remove bookmark Text Type (Simulate Keystrokes): <CTRLD><HOME><CTRLU> Text Type (Simulate Keystrokes): <CTRLD>f<CTRLU> Text Type (Simulate Keystrokes): !@#$%*** BOOKMARK ***!@#$%<ENTER><ESC> Text Type (Simulate Keystrokes): <CTRLD>v<CTRLU> Text Type (Simulate Keystrokes): <ARROW UP> Text Type (Simulate Keystrokes): <DELETE> // Macro Return
  21. Yes! Although I admit to getting sucked into doing too-big things with it myself. 🙄
  22. Clever idea, to automate the insertion of often-used commands. There's one thing I would like to have, and I wrote macros for in my last job, and that is bookmarking places in the code. I often will copy a block of code, and want to insert it elsewhere in the same macro. Lots of time is spent finding the code to be copied, then lots more time to re-find the insertion point and paste in the code. It is not unknown for me to paste it in the wrong place. 😧 So I will work on two macros: (1) Insert a "bookmark" comment into the script. (2) Copy to clipboard, re-find the bookmark, delete it, and in its place paste from the clipboard. After macro (1), of course, one would manually locate and highlight the block of code to be cloned, then run macro (2).
  23. Ctrl-1/2/3 etc. seem to work in Firefox and in IE also. If there are more than eight tabs in Firefox, Ctrl-9 takes you to the last one. Things I never knew before ....🙃
×
×
  • Create New...