Jump to content
UBot Underground

Problem With Focus When Interacting With Save As Dialog


Recommended Posts

Really hoping someone can help me with this.  I am trying to use various commands in the WindowsCommands.dll but I am running into a problem whenever the Save As dialog opens.  The problem is that once the Save As Dialog box opens after clicking the `Download` button on the page, focus then shifts to the Save As dialog and I cannot interact or debug with uBot while the Save As dialog is open.

 

Another problem is that I can only get the Save As dialog to even open if I stop the code immediately after the download line.  For example, if I use the following code, the Save As dialog box will open:

 

click(<id="download">,"Left Click","No")
stop script    

 

But if I don't use `stop script` and instead try to wait for the Save As dialog, it never opens up no matter how long I wait, which means that the WindowsCommands.dll do not work:

 

click(<id="download">,"Left Click","No")
wait(10)
plugin command("WindowsCommands.dll""set dialog text""Save As""File name:""blue.pdf")
wait(5)
plugin command("WindowsCommands.dll""click dialog button""Save As""Save")
stop script    

 

Any idea what I might be doing wrong?  Thanks for your help.

 

Link to post
Share on other sites

Hey Dan,

 

Did you try opening two instances of ubot studio.

 

Click the save as dialog in one, and sniff the info for the save as dialog with the other one using the wizard.

 

Give it a shot, it should work for you.

Link to post
Share on other sites

Your suggestion to use a 2nd, other instance of uBot allowed me to use the wizard as part of the `Set Active Window` Windows Command, to determine that the required syntax in my case should be:

 

plugin command("WindowsCommands.dll""set active window""MyBot_v2 - UBotStudio Professional Edition""HwndWrapper[uBot Studio.exe;;bb768e52-f762-4e77-8d90-e5f03683bf6e]")

 

I wouldn't have been able to determine the above Parent Class on my own without the help of your suggestion.  However, I am still have the same problem I was having before with regard to whether or not the Save As dialog will popup after clicking the Download button.  I don't know how else to explain it other than when I use this:

 

click(<id="download">,"Left Click","No")
stop script   

 

the Save As dialog will appear 4 or 5 seconds after clicking download, but when I use this:

 

     click(<id="download">,"Left Click","No")
    wait(50)
    plugin command("WindowsCommands.dll""set active window""MyBot_v2 - UBotStudio Professional Edition""HwndWrapper[uBot Studio.exe;;bb768e52-f762-4e77-8d90-e5f03683bf6e]")
    plugin command("WindowsCommands.dll""click dialog button""Save As""Save")
    alert("end")
    stop script

 

the Save As dialog will never appear whether I wait(5), wait(10) or wait(50).  Everything just seems to stall while I wait for the time to elapse, and the Save As dialog never appears, which means that the Windows Commands fail.  Eventually I receive the confirmation alert that the program has reached the end.

 

Any ideas what I might be doing wrong?  Why won't the Save As dialog box open up while uBot is running?

Edited by APTS
Link to post
Share on other sites

I had a similar problem with the controlling the save as dialogs with windows commands.

 

If I remember correctly, it is showing up, you just cannot see it.

 

Try running the commands as if it was there, and it should work.

 

I haven't used the windows commands in a long time, so I could be wrong but I believe it should work.

Give it a try

  • Like 1
Link to post
Share on other sites

Thanks for this comment a2mateit.  Just wondering - why is it that you haven't used the windows commands in a long time?  Is it because there are newer and better ways of getting the same things done?  I'm curious.

Link to post
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...
×
×
  • Create New...