Jump to content
Macro Express Forums

Clipboard Copy Is Not Working.


vvkp
 Share

Recommended Posts

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

Link to comment
Share on other sites

<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, Randall

PS

Clipboard Empty

Activate 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...