Forum Discussion

Aleksej's avatar
Aleksej
New Contributor
7 years ago

How to change clipboard

I have a text file that contains text and numbers. I copy the contents of the file to the clipboard. I need to round all the numbers in the clipboard and insert the modified contents of the into a new text file. How do I change the buffer via VBScript?

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    -- Assign the content of the clipboard to string variable (Dim str : str = Sys.Clipboard);

    -- Process string as you need (aqString and other helper objects provided by TestComplete);

    -- Save modified string to the file (aqFile, aqFileSystem objects).

     

    P.S. Not sure why you need to copy file content into clipboard... Just read file content into string variable, modify the variable and save into file.

    • Aleksej's avatar
      Aleksej
      New Contributor

      in fact I copy the data from the program sheet

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        AlexKaras has a good question - this sounds like there might be an easier way to do your test.

         

        Could you tell us what you are trying to accomplish?  Maybe we can help you simplify it.