nkormanik Posted March 8, 2012 Report Share Posted March 8, 2012 I'm using a "clipboard extender" that holds permanently everything copied to the clipboard. My Macro Express Pro macro, then, copies (Ctrl-C) blocks -- some blocks quite large -- in sequence, one after the other. Let's assume 100 copy actions, 100 blocks. Examining the finished compilation, unfortunately, some blocks are getting dropped. Say, only 79 blocks make it. 21 blocks get dropped. It appears that the next copy action is happening too fast, before the current block (presumably particularly large) is completely copied to clipboard. I've tried various lengths of DELAY -- 2, 4, 8 seconds -- between copy actions. With longer delays, fewer blocks get dropped. What would be ideal, though, would be a DYNAMIC DELAY, that would not proceed to the next copy action until each full block is safely copied into the clipboard, regardless of its size. Does such DYNAMIC DELAY currently exist in Macro Express Pro?? I see there is a "Wait for Control" possibility. Would that be the solution, as opposed to the "Delay" I presently use? Any help will be greatly appreciated. Nicholas Kormanik Quote Link to comment Share on other sites More sharing options...
acantor Posted March 8, 2012 Report Share Posted March 8, 2012 I wonder whether you would have better luck if you appended the copied text to a variable, did the manipulations in variable-space, and in the final stage, transfer the content of the variable to the clipboard. Quote Link to comment Share on other sites More sharing options...
paul Posted March 8, 2012 Report Share Posted March 8, 2012 My suggestion is to follow the logic below: Repeat until all variables have been copied to the clipboard repeat until %n[1]% <> %n[1]% (i.e. for ever) copy Var1 value to clipboard read clipboard value into Var2 if Var1 = Var2 exit inner repeat delay 500ms end inner repeat end outer repeat You can make this more sophisticated by counting the failures and terminating the macro after dome specified number of failures within the inner loop. Quote Link to comment Share on other sites More sharing options...
Cory Posted March 11, 2012 Report Share Posted March 11, 2012 You might try empty clipboard, copy to clipboard, then set variable to clipboard. Then you could have a loop with a short delay like 200mS that would only continue when clipboard does not equal nothing. Quote Link to comment Share on other sites More sharing options...
nostradamus3 Posted June 21, 2012 Report Share Posted June 21, 2012 Has anyone written a macro for MEP to copy text from text files located in a folder and appending the text sequentially to make an independent large text file containing all the text from the other text files? The text files are from a batch run on an OCR program called Tesseract OCR 3.01 run under GUI interface called VietOCR ( PS its FREE) Quote Link to comment Share on other sites More sharing options...
Cory Posted June 21, 2012 Report Share Posted June 21, 2012 Yes. Pretty simple. I've played with Tesseract. In fact I think I posted about it here someplace. Quote Link to comment Share on other sites More sharing options...
lemming Posted September 24, 2012 Report Share Posted September 24, 2012 You can just do this with plain old DOS copy command. Assuming all the text files are in one folder and you want the final file to be in the same folder, you just need cd to the right location and type: copy *.txt mergedfile.txt You can also make use of DOS in MEP to achieve similar results - just use Program Launch with cmd.exe, which is the command-line interpreter, i.e. the Dos prompt. You don't have to include the full path for cmd.exe. You can then put these in the Program Parameters: /K copy "C:\Users\Lemming\Desktop\test\*.txt" "C:\Users\Lemming\Desktop\test\mergedfile.txt" The /K option keeps the Dos window open after the command is finished. This would also pause your script till the window is closed. If you want the window to close immediately, change /K to /C. You'll also need to specify the full path for your files. Has anyone written a macro for MEP to copy text from text files located in a folder and appending the text sequentially to make an independent large text file containing all the text from the other text files? The text files are from a batch run on an OCR program called Tesseract OCR 3.01 run under GUI interface called VietOCR ( PS its FREE) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.