Sign in to follow this  
Followers 0
Guy_

how to "ok" repeated popup dialogs in browser?

5 posts in this topic

#1 ·  Posted (edited)

[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_

Share this post


Link to post
Share on other sites



I made an ImageShack Uploader here a while back. Try replacing the section of your code that uploads to ImageShack with my code and see if it clears up the problem.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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_

Share this post


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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

OK, I looked at it again and found the solution:

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

I've added it in the main script, so it should be working most of the time :whistle:

Edited by Guy_

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
Sign in to follow this  
Followers 0