vvkp Posted December 6, 2005 Report Share Posted December 6, 2005 Hi friends, I am using Macro Express Version 2.0e. When I tired to copy some lines from Notepad to winword repeatedly ( I did the same thing like in the documentation). But the ClipboardCopy is not working. Nothing is copied. But other things remained working fine. Also if I copy something using Ctrl+C then I am able to copy. When I execute the hotkey, the matter I copied is pasting in the word. Not the lines in notepad. Anyhelp is highly appreciated. Thanks in advance, Kris ps the hotkey is F6 and the script is like this... Repeat Start (Repeat 5 times) Activate Window: "notepad" Delay 0.5 Seconds Text Type: <SHIFT><END> Clipboard Copy Text Type: <HOME><DOWN ARROW> Activate Window: "wordpad" Delay 0.5 Seconds Clipboard Paste Text Type: <ENTER> Repeat End Quote Link to comment Share on other sites More sharing options...
randallc Posted December 6, 2005 Report Share Posted December 6, 2005 <CLIPE><ACTIVATE2:Notepad><WSHOW:Notepad><REP3:08:000002:000001:0001:1:01:T1><IMSD:20><TEXTTYPE:<CONTROL>a><CLIPC><TVAR2:01:03:><IVAR2:01:12:1><IFVAR2:2:01:4:0><EXITREP><ENDIF><ENDREP><LAUNCHNO3:0:0112WordPad<LAUNCH:WordPad.exe><WSHOW:WordPad><CLIPP>Best, RandallPS Clipboard EmptyActivate Window: "Notepad" Window Show: "Notepad" Repeat Until %T1% <> %T1% Delay 20 Milliseconds Text Type: <CONTROL>a Clipboard Copy Variable Set String %T1% from Clipboard Variable Set Integer %N1% from Length of Variable %T1% If Variable %N1% > 0 Repeat Exit End If Repeat End Launch and Activate: "WordPad.exe" Window Show: "WordPad" Clipboard Paste Quote Link to comment Share on other sites More sharing options...
vvkp Posted December 6, 2005 Author Report Share Posted December 6, 2005 Hi, Thanks for your kind reply. In the 2e version, the command Repeat Exit is not there. Any idea? Quote Link to comment Share on other sites More sharing options...
kevin Posted December 6, 2005 Report Share Posted December 6, 2005 Use the Repeat End instead of Repeat Exit in Macro Express v 2.0e. Quote Link to comment Share on other sites More sharing options...
vvkp Posted December 6, 2005 Author Report Share Posted December 6, 2005 No Luck...if I use Repeat End then its giving error No "EndIf" statement that matches the initial if condition in the macro. macro will abort. Can anyone help me? THe compleete script is like this.... (I am doing line by line copy...I mean one line copied and paste the same one line at a time) Clipboard Empty Activate Window: "Notepad" Repeat Until %T1% <> %T1% Delay 20 Milliseconds Text Type: <SHIFT><END> Clipboard Copy Variable Set String %T1% from Clipboard Variable Set Integer %N1% from Length of Variable %T1% If Variable %N1% > 0 Repeat END End If Repeat End Activate Window: "Document1" Clipboard Paste Quote Link to comment Share on other sites More sharing options...
randallc Posted December 6, 2005 Report Share Posted December 6, 2005 Hi, Try "Break"; is that in version "2.0e"? [is it there?] [if you are really using such an old version, it may "break" out of any loops it finds itself in, rather than just the one you want?..... btw] btw, I had to go back to version "3.5d" as it broke too many macros..... Anyone else? Randall Quote Link to comment Share on other sites More sharing options...
vvkp Posted December 6, 2005 Author Report Share Posted December 6, 2005 Break is also not in version2e Quote Link to comment Share on other sites More sharing options...
kevin Posted December 6, 2005 Report Share Posted December 6, 2005 My mistake. It turns out that there is not a command in v 2.0e to break out of a Repeat loop. It has been several years since I have written a macro in Macro Express 2000 and I got confused. You can use the Repeat Until command to break out of a Repeat loop. Your macro would look something like this: Clipboard Copy Window Activate: "Notepad" Variable Set String T99 to Repeat Until T99 = END Delay 20 Milliseconds Text Type: <SHIFT><END> Clipboard Copy Variable Set String T1 from clipboard Variable Set Integer N1 from length of variable T1 If Variable N1 > 0 Variable Set String T99 to END End If Repeat End Window Activate: "Document1" Clipboard Paste But this code will not work. It is likely to get stuck in an infinite loop if there isn't anything in the clipboard. Something like this would make sure you don't get stuck in a loop: Clipboard Copy Window Activeate: "Notepad" Variable Set String T99 to Variable Set Integer N50 to 1 Repeat Until T99 = END Delay 20 Milliseconds Text Type: <SHIFT><END> Clipboard Copy Variable Set String T1 from clipboard Variable Set Integer N1 from length of variable T1 If Variable N1 > 0 Variable Set String T99 to END End If Variable Modify Integer: N50 = N50 + 1 If Variable N50 > 50 Variable Set String T99 to END End If Repeat End Window Activate: "Document1" Clipboard Paste I cannot guarantee that this macro will do what you want but it won't lock up. I don't think this will work properly: Text Type: <SHIFT><END> What you need is something like this: Text Type: <SHIFTD><END><SHIFTU> Macro Express 3.x can do this but I don't know if Macro Express 2.x can. Quote Link to comment Share on other sites More sharing options...
vvkp Posted December 7, 2005 Author Report Share Posted December 7, 2005 Please accept my sincere thanks for your help. But ...No Luck...the problem I found is as you said <SHIFT><END> is not working. So I am not able to copy the total line itself....any ideas please? Quote Link to comment Share on other sites More sharing options...
joe Posted December 7, 2005 Report Share Posted December 7, 2005 Hello vvkp any ideas please One idea would be upgrading to the latest Macro Express release. Version 3.5e. 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.