1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Get CLIP: into a MSGBOX?

Discussion in 'Support' started by vefatica, Jul 31, 2010.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    MSGBOX handles multiline messages. How can I get the contents of the clipboard into a MSGBOX.

    For my immediate purpose, a file would do as well as the clipboard. Perhaps a future version will support "MSGBOX ... @file" (maybe including @CLIP:).
     
  2. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    If I do the following;

    Code:
    set jlc=Line 1^r^nLine 2^r^nLine 3^r^n
    then

    Code:
    msgbox ok "Test" %jlc
    I get three lines of text in the msgbox.

    If you process the clipboard, adding ^r^n to the end of each line, directing the result to an environment variable, this might do what you want.

    Reference: http://www.jpsoft.com/forums/showthread.php?t=1553

    Joe
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    On Sat, 31 Jul 2010 15:50:52 -0400, Joe Caverly
    <> wrote:

    |If you process the clipboard, adding ^r^n to the end of each line, directing the result to an environment variable, this might do what you want.

    I was aware of that brute-force method.

    And I think SET would gobble up those escape sequences.

    I wrote a little plugin:

    Code:
    v:\> escape /?
    In a pipe only - CRLF to ^r^n; escape & | > < and %
    
    v:\> echo Line 1^r^nLine 2 | escape > clip:
    
    v:\> echo %@clip[0]
    Line 1
    Line 2
    It works with MSGBOX, too, as I originally wanted.

    Is it of any general value?
     

Share This Page