Popup message

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
HSEIVANE
Junior Coder
Posts: 33
Joined: Thu Jan 02, 2020 2:52 am

Popup message

Post by HSEIVANE » Sun Jan 12, 2020 1:19 am

I have the following problem, on one site, a popup message appears ramdomly, and I don't know when, is there a way to leave a routine checking that if that message appears, take an action and then continue with the macro from where it was

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 682
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Popup message

Post by Dorian (MJT support) » Sun Jan 12, 2020 11:56 pm

OnEvent sounds like a good place to start, if it's a window that opens. If it can be tracked by pixel color in a specific location, there's also that option too.
Yes, we have a Custom Scripting Service. Message me or go here

HSEIVANE
Junior Coder
Posts: 33
Joined: Thu Jan 02, 2020 2:52 am

Re: Popup message

Post by HSEIVANE » Mon Jan 13, 2020 3:03 pm

The problem is these popup is a chrome extension, appears into the chrome screen.

HSEIVANE
Junior Coder
Posts: 33
Joined: Thu Jan 02, 2020 2:52 am

Re: Popup message

Post by HSEIVANE » Mon Jan 13, 2020 3:22 pm

I've forgotten to add an image

https://www.screencast.com/t/fczxtwn5ne2H

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 682
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Popup message

Post by Dorian (MJT support) » Tue Jan 14, 2020 11:50 am

Does it always pop up in the same place? If so, can you use OnEvent to watch for the pixel color. However, that blue could inadvertently be present in that location if you were scrolling, so in the subroutine I'd suggest using Image Recognition to click the button, followed by any actions you wish to perform in the SRT.

Something like this :

Code: Select all

//Watch for pixel colour
OnEvent>pixel_color,1942:1239,11564288,ClickUpdateButton

//Replace this with the rest of your script.
label>start
wait>1
goto>start

//Click the Update button
SRT>ClickUpdateButton
  FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
  If>NumFound>0
    MouseMove>XArr_0,YArr_0
    LClick
  Endif
END>ClickUpdateButton
Yes, we have a Custom Scripting Service. Message me or go here

HSEIVANE
Junior Coder
Posts: 33
Joined: Thu Jan 02, 2020 2:52 am

Re: Popup message

Post by HSEIVANE » Wed Jan 15, 2020 7:11 pm

Sorry, it does not work...

What I should use in order to get the pixel colour and coordinates?

The wizard does not return that.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 682
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Popup message

Post by Dorian (MJT support) » Fri Jan 17, 2020 9:57 am

I made you a video showing how to get those. Link
Yes, we have a Custom Scripting Service. Message me or go here

HSEIVANE
Junior Coder
Posts: 33
Joined: Thu Jan 02, 2020 2:52 am

Re: Popup message

Post by HSEIVANE » Fri Jan 17, 2020 2:39 pm

Thanks, the only problem the solution to copy to the clipboard is not working. I've pressed left and right buttons at the same time but nothing happened.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 682
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Popup message

Post by Dorian (MJT support) » Mon Jan 20, 2020 10:19 am

Follow Cursor has to be enabled.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts