Jump to content

how to "ok" repeated popup dialogs in browser?


Guy_
 Share

Recommended Posts

[fully working now]

I've been sitting on this for quite a while, because I couldn't find how to start the script from inside Photoshop, but that's cured now.

Save in a .jsx file and put in PS scripts folder, e.g.:

var upload = new File("/c/upload/AutoIt_upload.exe");
upload.execute();

An action in Photoshop also saves the picture to c:\upload\picture.jpg and then calls the PS script that calls the AutoIt script.

This AI script is kinda working a lot of the time, but is critical on some timings and how the pages are made up. Hopefully they'll remain the same for a while.

The problem is that while uploading I now often get these popups (didn't used to, so you might not) which I'd like to kill automatically. They can reoccur more than once while the upload is going on, so ideally, I'd need a way to 'ok' (enter) all of them (either "stop" or "continue" works).

Posted Image

I don't even know what software is generating them...

SOLUTION (also added in main script) [update]:

While Not WinExists("Hosting -") ; Try to close dialog if popping up (trial)
If WinExists("Warning:") Then
    Send("{ENTER}")
EndIf
WEnd

The .bat files look like this:

FF_openUrl_ImageShack.bat

"c:\Program Files\Mozilla Firefox\firefox.exe" "http://imageshack.us/index4.php"

FF_newTab_openUrl_ImageShack.bat

"c:\Program Files\Mozilla Firefox\firefox.exe" -new-tab "http://imageshack.us/index4.php"
Edited by Guy_
Link to comment
Share on other sites

Looks like a great little piece of code I might use for the IE variation, but personally I only use Firefox and IE won't even connect on my current partition...

I also have a feeling that these popups could be some personal problem caused by some Firefox things that are clashing. So the uploading code is not the biggest problem, but the solution to closing these popups. Should be easy for someone less newbie than me, though.

Anyway, great to learn of your script! Thanks :whistle:

Edited by Guy_
Link to comment
Share on other sites

BTW: I realise that when a popup comes up, the scripts continues from WEnd, but when I placed the closing code after WEnd, the popup didn't go away either...

And it should be in some sort of loop, because they can come repeatedly.

While Not WinExists("Warning: Unresponsive script") ; if no popups...
    WinWait("Hosting -") ; wait for final web page with all picture urls
If WinActive("Warning:") Then  ; if popup
    Send("{ENTER}")  ; close it
EndIf
WEnd
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...