Jump to content
Macro Express Forums

Search for website pop up


selkov
 Share

Recommended Posts

I use a music service on the web and every hour or so a pop box comes up and freezes the radio stream.

It doe snot do so at home, only at work. I do not know why. The obvious solution is to just close the box and it works fine.

 

What i am in need of is a macro that will run always and when it sees that pop up close it.

 

But i need some help to do it.

 

Anyone please?

Link to comment
Share on other sites

I use a music service on the web and every hour or so a pop box comes up and freezes the radio stream.

It doe snot do so at home, only at work. I do not know why. The obvious solution is to just close the box and it works fine.

 

What i am in need of is a macro that will run always and when it sees that pop up close it.

 

But i need some help to do it.

 

Anyone please?

 

I'd suggest you write a simple macro like the following and set its activation to Schedule, with Run Macro set to Other, Play Macro Indefinitely checked and Other set to an interval of your choice. I've specified 10 seconds. But relevant factors will include what other macros you use (only one can run at any time), how long you can wait for your music stream to be restored, etc. In this demo I've used Notepad instead of your unspecified pop-up. I simulated your pop-up scenario by opening the file Test-selkov.txt at random intervals. You wouldn't want the Text Display command in practice, of course.

 

If Window Title "Test-selkov" is running

Text Box Display: Pop-up detected

Text Type: <ALT>fx

Delay 100 Milliseconds

End If

Delay 100 Milliseconds

Macro Return

 

<IFOTH:04:2:Test-selkov><TBOX4:T:4:CenterCenter000278000200:000:Pop-up detectedA window with 'selkov' in its title has appeared, and will be closed when you click OK or press Enter.><TEXTTYPE:<ALT>fx><MSD:100><ENDIF><MSD:100><MRETURN>

 

BTW, note that Schedule activation is not reliable. It's been discussed in previous threads but I still don't know the explanation for that. In this particular example I typically got only 4 occurrences in a minute, with a max of 5 and a min of 3.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Tried that but it does not work.

Upon greater investigation I think the Pop up is actually tied to the media player itself.

Or maybe a java flash in one of the frames.....

 

Any ideas?

 

Sorry, no, not without full and accurate details of the applications involved and an exact description of the behaviour you get.

 

I'm curious to know what happened when you ran that macro I wrote, after suitably adapting it for your pop-up title?

 

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Here's one that works with Sirius. I have it scheduled to run every 8 seconds. It checks the pixel color at the spot where the popup occurs within the Sirius window. If the color is other than "standard" it moves the mouse to that spot and clicks the mouse. The drawback with this macro is that it has to bring the Sirius window into focus every time it runs. That's OK for me because I only activate the macro when I am listening to music at home and not using the computer for anything else. It would be very disruptive if I were trying to do other work on the computer. Of course, if you are sitting right there working on the computer, you could just click on it yourself.

 

Can you give more details of what your popup actually looks like?

 

<REM2:If Sirius is active, save mouse position on current window, switch to Sirius window,><REM2:Check the color of the area where the "Are you still listening?" question appears, ><REM2:If it is other than its standard color, click it to reply and it should go away. ><REM2:Then switch back to original window and restore mouse to its original position><IFOTH:04:2:www.sirius.com><MOUSEPOS:T:01:02><ACTIVATE2:www.sirius.com><WAITTIME:00000001><REM2: ><IVAR2:03:01:291><IVAR2:04:01:338><GETPX:5:W:%N3%:%N4%><DIS:<LOGFILE:YY:Color retrieved from screen location %N3%,%N4% is %N5%><DIS:<TBOX4:T:4:CenterCenter000278000200:000:DebuggingColor retrieved from screen location

%N3%,%N4%

is

N5 = %N5%><IFVAR2:2:05:2:15921906><MMW2:3N,4N><IMSD:400><LCLK><LOGFILE:YY:Color retrieved from screen location %N3%,%N4% is %N5%><LOGFILE:YY:Clicked on popup to keep Sirius alive><WAITTIME:00000001><MMS2:1N,2N><ENDIF><REM2: ><ENDIF>

Link to comment
Share on other sites

terrypin - when I ran the macro nothing happened.

 

scasper - yes it is pandora - do you have a solution?

 

rberq - interesting - will try to play with that. I have an idea....can you get the info on where the focus is prior to switching to the new page and then after running the macro return to the point where you where?

Link to comment
Share on other sites

terrypin - when I ran the macro nothing happened.

 

Do you mean it didn't close the window, whose (possibly partial) name you'd entered in the command to replace my example? Was the pop-up window open when the macro ran? Did you see the running man icon appear on schedule?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

rberq - interesting - will try to play with that .... can you get the info on where the focus is prior to switching to the new page and then after running the macro return to the point where you where?

The macro as I posted it already saves the starting mouse position (screen relative) and puts the mouse back there when it's done. Before checking the pop-up, you can do "Variable Set String from Topmost Window Title" to store where you are coming from. Then after disposing of the pop-up you can Activate that window. But you can only check color on the topmost window, or at some point on the screen meaning the window in question has to be visible. So even if you can get it to go back to your original window, it's still going to be disruptive if you are trying to do more on the computer than just listen to music. There are some timing delays in my macro that you may be able to remove.

Link to comment
Share on other sites

scasper - yes it is pandora - do you have a solution?

I've been listening to Pandora today. The dialog that comes up says something like "You haven't clicked on anything for a while, are you still there?" Perhaps it would be best not to try to close that dialog but to avoid it in the first place. If I recall correctly, Pandora last displayed that dialog for me after I had been listening for 5 hours or so. Try creating a macro that clicks on something to reset the 'are you there' counter. For example, you could click to pause and resume playback.

 

Try something like this:

1. Create a scheduled macro that runs every hour (or every 2, 3, 4 or 5 hours ... your choice). You might want it to check to see if Pandora is running and quit if not. The Scope setting may help.

 

2. Find the 'run/pause' button on the Pandora screen. On my browsers this is in a set position from the top of the browser window and nearly a set position from the left side of the browser window. Create a repeat loop that contains a Get Pixel Color command and increments the Y position until it finds the orange 'play' button'.

 

3. Once you have the X and Y coordinates move the mouse to that location and do a left click. Delay. Left Click again.

 

You might want to save the mouse position before step #3 and then restore it after step #3.

 

Good luck. This sounds like a fun macro to write. When you have it working maybe you would consider sharing it.

Link to comment
Share on other sites

terrypin - when I ran the macro nothing happened.

 

scasper - yes it is pandora - do you have a solution?

 

rberq - interesting - will try to play with that. I have an idea....can you get the info on where the focus is prior to switching to the new page and then after running the macro return to the point where you where?

Sorry, I've been busy for a while. But my answer is basically: "What Kevin said."

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...