Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check to see if clipboard text = ??
#1
Hi,

I'm currently using the below code do perform an action if the text on the clipboard equals a certain value.

However, the text I am checking is now always different adn I require to check the value on the clipboard to see if a certain value is in the text and if it is perform an action.

Can this be done?

eg.

The text on the clipboard is "test1 test2 test3".

So I want it to check if the clipboard text contains "test2" and then perform an action if it does contain "text2".

Is this possible? as the code I am currently using checks to make sure the entire text is the same.

Here is my old code, this worked previously as I was able to just select the Test2 part of the text as it was always in the same place. However now i have to select a full line of text as the Test2 part is always at a different part of the sentance.

Code:
Copy      Help
sel _s.getclip 1
    case "Test2"
    out "yes"
    key "Text does contain Test2."
    case else
    key "Text does not contain Test2."
#2
Code:
Copy      Help
sel _s.getclip 3
   case "*Test2*"
   out "yes"
#3
Thanks Gintaras! Smile

Is it also possible to have it perform the action if it says "Test2" or "Test3" in the text on the clipboard?

Thanks.
#4
use function find, for example.


Forum Jump:


Users browsing this thread: 1 Guest(s)