Jump to content
JohnnyDepth

If clipboard contains "x"

Recommended Posts

JohnnyDepth

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

Share this post


Link to post
Share on other sites
JohnnyDepth

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)

Share this post


Link to post
Share on other sites
Danyfirex

You're not looking into the help file.

 

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

 

Saludos

Share this post


Link to post
Share on other sites
iamtheky

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')

 

  • Like 1

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

Share this post


Link to post
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

×