Clipboard swap macro

Clipboard swap macro

30
Basic UserBasic User
30

    Mar 16, 2005#1

    Hey folks,

    I've written the following macro which swaps selected text with the contents of the clipboard. As you'll notice, it uses a 'Find' . I am hoping someone can think up a better way that doesn't use 'Find', since it clobbers the 'last searched for' thing.

    It basically copies the currently selected text into clipboard 8, pastes the contents of clipboard 0, and then needs to shift the contents of clipboard 8 to clipboard 0. To do this, it switches back to 8, pastes the contents, uses a reverse find to match what was just pasted to the contents of clipboard 8, switches to clipboard 0 and cuts it in. Surely, there's a simpler way to do this.

    Code: Select all

    IfSel
    Clipboard 8
    Cut 
    Clipboard 0
    Paste 
    Clipboard 8
    Paste 
    Find Up Select "^c"
    Clipboard 0
    Cut 
    EndIf
    

    46
    Basic UserBasic User
    46

      Apr 11, 2005#2

      Hi Roland,

      You can use a temporary file to do what you want without a "Find".
      Simply Paste the Clipboard 8's content into a new file, switch to
      Clipboard 0, Select all, cut and then force close the new file.

      See Macro language help for right syntax.

      HTH (Hope This Help.
      Alain
      Never forget: "Above the clouds, The sky is blue and the sun shine"