Samrae

Members
  • Content count

    272
  • Joined

  • Last visited

  • Days Won

    6

Samrae last won the day on October 25 2016

Samrae had the most liked content!

Community Reputation

7 Neutral

About Samrae

  • Rank
    Advanced

Profile Information

  • Gender
    Male
  1. Here is an idea about how to tackle it. You will need two macros. Macro 1 - gets the list of files and stores them in a file. Run this only once to set up. Something like this. (You will need to change the paths): // Delete registry counter and files to set things up to process files Delete Registry Value: HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express 4\$Temp\NextFileNumber // Delete the file number, if it exists Delete File/Files: "e:\FilesToProcess.txt" // Delete output file, if it exists // Get a list of the files to process Repeat with Folder e:\temp Variable Modify String: Append %File% to text file, "e:\FilesToProcess.txt" End Repeat Macro 2 - opens the next file from the list. Run each time you are finished manually processing one file. (Again, you will need to change the paths): // Use a hotkey activation for this macro // Get the NextFileNumber from the registry Variable Set Integer %NextFileNumber% to 1 // Default in case the registry value does not exist Read Registry Value "HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express 4\$Temp\NextFileNumber" into %NextFileNumber% // Get number of file to use // Get the name of the next file in the list Text File Begin Process: e:\FilesToProcess.txt Break // Only get one file Text File End Process // If NextFilename is blank then all files have been processed If Variable %NextFilename% Equals "" Text Box Display: Done Macro Stop End If // Increment and save the NextFileNumber to the registry Variable Modify Integer %NextFileNumber%: Increment Write Registry Value "%NextFileNumber%" into HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express 4\$Temp\NextFileNumber // Get number of file to use Variable Set From File path // Get file extension Text Box Display: Opening file If Variable %Ext% Equals ".pdf" // Process pdf files OR If Variable %Ext% Equals ".txt" // or txt files OR If Variable %Ext% Equals ".doc" // or doc files OR If Variable %Ext% Equals ".docx" // or docx files OR If Variable %Ext% Equals ".jpg" // or jpg files OR If Variable %Ext% Equals ".png" // or png files OR If Variable %Ext% Equals ".ini" // or ini files Change Directory/Folder to "e:\temp" Program Launch: "%NextFilename%" (Normal) Parameters: Else Delay: 1 seconds End If Here is code you can copy and paste for the "Get filenames" macro: <COMMENT Value="----------------------------------------------------------------------------------------------------------------------------------"/> <COMMENT Value=" Get filenames -"/> <COMMENT Value="----------------------------------------------------------------------------------------------------------------------------------"/> <COMMENT/> <COMMENT Value="Delete registry counter and files to set things up to process files"/> <DELETE REGISTRY VALUE Value="HKEY_CURRENT_USER\\Software\\Insight Software Solutions\\Macro Express 4\\$Temp\\NextFileNumber" _IGNORE="0x0025" _COMMENT="Delete the file number, if it exists"/> <DELETE FILE/FILES Path="e:\\FilesToProcess.txt" Progress="FALSE" Recurse="FALSE" Permanent="FALSE" _COMMENT="Delete output file, if it exists"/> <COMMENT/> <COMMENT Value="Get a list of the files to process"/> <REPEAT WITH FOLDER Path="e:\\temp" OnlyFiles="TRUE" Destination="%File%" FullPath="FALSE" ProcSubfolders="FALSE"/> <VARIABLE MODIFY STRING Option="\x12" Destination="%File%" Filename="e:\\FilesToProcess.txt" Strip="TRUE" NoEmbeddedVars="FALSE"/> <END REPEAT/> Here is code you can copy and past for the "Process one file" macro: <COMMENT Value="----------------------------------------------------------------------------------------------------------------------------------"/> <COMMENT Value="Process one file - "/> <COMMENT Value="----------------------------------------------------------------------------------------------------------------------------------"/> <COMMENT Value="Use a hotkey activation for this macro"/> <COMMENT/> <COMMENT Value="Get the NextFileNumber from the registry"/> <VARIABLE SET INTEGER Option="\x00" Destination="%NextFileNumber%" Value="1" _COMMENT="Default in case the registry value does not exist"/> <READ REGISTRY VALUE Key="HKEY_CURRENT_USER\\Software\\Insight Software Solutions\\Macro Express 4\\$Temp\\NextFileNumber" Destination="%NextFileNumber%" _COMMENT="Get number of file to use"/> <COMMENT/> <COMMENT Value="Get the name of the next file in the list"/> <TEXT FILE BEGIN PROCESS Filename="e:\\FilesToProcess.txt" Start_Record="%NextFileNumber%" Process_All="TRUE" Records="1" Variable="%NextFilename%"/> <BREAK _COMMENT="Only get one file"/> <TEXT FILE END PROCESS/> <COMMENT/> <COMMENT Value="If NextFilename is blank then all files have been processed"/> <IF VARIABLE Variable="%NextFilename%" Condition="\x00" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="Done" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red0\\green0\\blue255;}\r\n\\viewkind4\\uc1\\pard\\qc\\cf1\\f0\\fs24 All files have been processed.\\cf0\\f1\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="337" Height="125" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO STOP/> <END IF/> <COMMENT/> <COMMENT Value="Increment and save the NextFileNumber to the registry"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%NextFileNumber%"/> <WRITE REGISTRY VALUE Key="HKEY_CURRENT_USER\\Software\\Insight Software Solutions\\Macro Express 4\\$Temp\\NextFileNumber" Destination="%NextFileNumber%" _COMMENT="Get number of file to use"/> <COMMENT/> <COMMENT/> <VARIABLE SET FROM FILE Filename="e:\\temp\\%NextFilename%" Option="\x01" Extension="%Ext%" Expand="FALSE" Flags="\x08" _COMMENT="Get file extension"/> <COMMENT/> <TEXT BOX DISPLAY Title="Opening file" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Opening File %NextFilename%\r\n\\par Extension: %Ext%\\f1 \r\n\\par }\r\n" Left="Center" Top="Top" Width="574" Height="97" Monitor="0" OnTop="TRUE" Keep_Focus="FALSE" Mode="\x01" Delay="0"/> <IF VARIABLE Variable="%Ext%" Condition="\x00" Value=".pdf" IgnoreCase="TRUE" _COMMENT="Process pdf files"/> <OR/> <IF VARIABLE Variable="%Ext%" Condition="\x00" Value=".txt" IgnoreCase="TRUE" _COMMENT="or txt files"/> <OR/> <IF VARIABLE Variable="%Ext%" Condition="\x00" Value=".doc" IgnoreCase="TRUE" _COMMENT="or doc files"/> <OR/> <IF VARIABLE Variable="%Ext%" Condition="\x00" Value=".docx" IgnoreCase="TRUE" _COMMENT="or docx files"/> <OR/> <IF VARIABLE Variable="%Ext%" Condition="\x00" Value=".jpg" IgnoreCase="TRUE" _COMMENT="or jpg files"/> <OR/> <IF VARIABLE Variable="%Ext%" Condition="\x00" Value=".png" IgnoreCase="TRUE" _COMMENT="or png files"/> <OR/> <IF VARIABLE Variable="%Ext%" Condition="\x00" Value=".ini" IgnoreCase="TRUE" _COMMENT="or ini files"/> <CHANGE DIRECTORY/FOLDER Path="e:\\temp"/> <PROGRAM LAUNCH Path="%NextFilename%" Mode="\x00" Default_Path="TRUE" Wait="1" Get_Console="FALSE"/> <ELSE/> <DELAY Flags="\x01" Time="1"/> <END IF/>
  2. When you press something like Ctrl+z it goes to the window that has focus. If Macro Express types Ctrl+z then it too goes to the window that has focus. In order to have a macro undo the delete you need to the macro set focus to File Explorer. Does the Windows Recycle Bin do what you need? If you accidentally delete something you can use the Recycle bin to recover it.
  3. No. Macro Express does not have a built-in undelete file command and in order for File Explorer to perform the undelete it must have focus. The only thing I would consider changing is instead of 1) minimize everything I would use the Window Activate command to give File Explorer focus but leave all the other windows alone.
  4. What do you mean "when 1 gets entered"? Are you pressing the 1 key? I can answer one of your questions. You can only assign one activation of each type to a single macro. You can only assign one hotkey at a time. Once a macro is activated it can perform different actions depending on other information.
  5. Whenever I see something like "ME goes nuts and does other actions unrelated to what I want to do" it tells me that the macro needs to slow down. Try adding Delay commands to your macro. Even when I record a macro I go back and and edit the macro via the Scripting Editor to optimize it.
  6. As far as I know you need to install Macro Express on the remote computer. However, I found some articles about using Macro Express with Remote Desktop Connection that hint otherwise. It sounds like it may be possible for your macros to work on the remote computer. Maybe you could try what the articles suggest and let us know how it turns out. macros do not work when using a Remote Desktop Connection in full screen mode How can I use Macro Express with Remote Desktop Connection? using the Remote Desktop Client in full-screen mode, my macros will not work
  7. I'm not sure what you mean by "a remote browser from Windows 10". Could you explain?
  8. I do not understand what this means. Is the macro being activated? Did you try one of the techniques above? What program are you typing into?
  9. The first thing to determine is whether or not the macro is being activated. You can do this one of several ways. Put a Text Box display at the top of your macro. It may say something like "The macro has started" Put a Sound File command at the top of your macro. Open the Macro Explorer. Click Options, Preferences, Playback and the Miscellaneous tab. Click to enable the "Play a sound when a macro runs" and choose a sound. If your macro is not being activated choose a different activation. If you continue to have trouble tell us specifically what activation you are trying to use. If the macro is being activated then you can use several techniques to debug it. Here are some ideas: Use the built-in debugger to step line by line through your macro Put Text Box Display commands throughout your macro
  10. Try "Variable Set String: Prompt" and "Variable Set Integer: Prompt" commands. Something like this may get you started: Variable Set String %Used%: Prompt Variable Set String %New%: Prompt Variable Set Integer %iUnits%: Prompt Text Type (Simulate Keystrokes): Finished with %Used% vehicles vs %New% in ___ 2016 (%Units%) <VARIABLE SET STRING Option="\x01" Destination="%Used%" Prompt="Enter used vehicles" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/> <VARIABLE SET STRING Option="\x01" Destination="%New%" Prompt="Enter new vehicles" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/> <VARIABLE SET INTEGER Option="\x01" Destination="%iUnits%" Prompt="Enter number of units" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/> <TEXT TYPE Action="0" Text="Finished with %Used% vehicles vs %New% in ___ 2016 (%Units%)"/>
  11. The non-portable version of Macro Express Pro can be configured with certain macro files that cannot be closed by the user. These are referred to as Persistent macro files. You can save macros with Macro Express Pro Portable in one or more macro files.
  12. The only way I am aware of to run Macro Express Pro as administrator without the UAC prompt is via the Task Scheduler. Your description of the task in Task Scheduler differs from this documentation: How to Run Macro Express as Administrator when Windows Starts. That example does not use cmd.exe. Because I do not load Macro Express Pro as admin I use the standard Macro Express Pro startup option found in Options, Preferences, Startup. If a startup macro does not consistently run when Macro Express Pro is loaded when Windows starts you may want to try the "Wait for [ ] seconds before initializing the program" setting found in Options, Preferences, Startup. This article has more information: Startup macros do not work when Macro Express is loaded when Windows starts.
  13. We have drifted a bit from the original topic for this thread but ... Linux, Unix and MacOS use LF as a line terminator. As mentioned, Windows uses CRLF. This difference can cause issues with files retrieved from different systems.
  14. Here are two other ways to append a carriage return to a text file. Note that in Windows lines are terminated with two control characters: CR LF 1. The "Variable Modify String: Append %T1% to Text File" has a checkbox that says to include CR/LF. You could use this with an empty variable to append only CRLF. 2. This is what I do. At the top of my macro I include these: Variable Set %T13% to ASCII Char of 13 Variable Set %T10% to ASCII Char of 10 Then when setting strings I do something like this: Variable Set String %T1% "SomeValue%T13%%T10%"
  15. Try this: Variable Set Integer %N1% to 0 Text File Begin Process: "FileIn.txt" Variable Modify Integer: Inc (%N1%) Text File End Process // Here %N1% contains the number of lines Copy and paste this code: <IVAR2:01:01:0><BTFBEG:001:000001:000000:c:\Users\username\Documents\FileIn.txt><NMVAR:08:01:0:0000001:0:0000000><BTFEND><REM2:><REM2:Here %N1% contains the number of lines>