Jump to content

If clipboard contains "x"


Recommended Posts

Hi!

I am trying to write a script that copies all text from a website and if it the clipboard contains a certain word, a message box will appear with that word.

 

Let's just use the word "Hello" as an example:

Snippet:

MouseClick("left",2115,238)
    Sleep(500)
    Send("^a")
    Sleep(200)
    Send("^c")
    Sleep(200)
    MouseClick("left",2115,238)
    
    ;the part i am needing help with is finding the word "Hello" in the clipboard
    ;Logic would be:
    ;if clipboard contains "hello" then
    ;   MsgBox($MB_OK,"Attention","Hello exists!")
    ;else
    ;   MsgBox($MB_OK,"Attention","Hello does not exist :(")
    ;endif

If anyone can help me with the "clipboard contains "hello" line, that would be awesome!

Edited by JohnnyDepth
Link to comment
Share on other sites

Not sure why it has everything under the first mouseclick tabbed over, but it shouldn't be like that.  Also, I added the same mouseclick at the end of that snippet so the website would not be blue(when you ctrl-a to select everything)

Link to comment
Share on other sites

Link to comment
Share on other sites

maybe also look at _INetGetSource rather than using send, as send is super unreliable.  

If that captures the desired text then you could probably use dany's same syntax and do something like

if StringInStr(_INetGetSource('URL'),'hello') then MsgBox(0,'','Hello world found')

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...