Jump to content

Recommended Posts

Posted

It works fine for me - always has.

Add this to the top of your script and share the output from SciTe:

#AutoIt3Wrapper_run_debug_mode=Y

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted (edited)

  dmt740 said:

I just read your referenced example. I copied the code from the post and ran it, and it doesnt work. The Ok button window just sits there. Any other ideas?

EDIT: Ok, I changed the WinWait and ControlClick to Microsoft Internet Explorer instead of Windows Internet Explorer and the example now works. Now I just have to figure out how to incorporate this into a Save As box. (Any ideas?)

EDIT2: I just checked Example 1 and it doesn't work either. And I can't see anything thats mislabeled in that one.

Edited by dmt740
Posted (edited)

Ok, sorry for all the posting <_< but I can't make it work. If someone can give me the code to click(or whatever) the Save button on a save as(or save picture) box, please please please post it. I'm pulling out what's left of my hair, and I'm really frustrated. Thanks for the suggestions so far.

#include <ie.au3>

$oIE = _IECreate("http://www.ibm.com/us/images/2007/10/102207_migration_final.jpg")
_IEAction($oIE, "saveas");anything after this is stopped until you click on the Save Picture box then the script continues
;why?
MsgBox(0, "title", "Test")

Run this and tell me what happens.

Any suggestions?

One more edit :) Its the _IEAction that is causing the issue. I finally got the script to work if I take it out and use MouseClick and a bunch of Sends. But the original issues remains: why wont _IEAction work??!?

Edited by dmt740
Posted

  dmt740 said:

Anyone? Anyone? Has anyone else had this problem, or tell me why it happens, or have a solution for it?!?

The problem is that the $o_object.document.execCommand("SaveAs") function used in the UDF _IEAction function in the IE.au3 UDF is not returning until the action is complete i.e. the dialog closed and the file saved.

One reason for this not working is that the execCommand() function has not been fully implemented in IE.au3 UDF _IEAction function.

The execCommand() can take 2 optional arguments for some actions SaveAs is one of these.

The second optional agrument is supposed to determine if the userinterface is displayed or not

The third optional argument is the name to save the file as.

See link for details.

http://msdn2.microsoft.com/en-us/library/ms536419.aspx

Having I've still not been able to not get the Save dialog to display on my system (XP Home SP2 IE7)

I have however come up with a workaround, but it's a bit of a kludge.

What I've done is to create a seperate script whose sole purpose is to process the SaveAs dialog.

Complile this script.

;SaveAs.au3
;Inserts filename and 
;closes Save As dialog

Dim $sCaption = "Save Picture"
Dim $sNewFileName = ""

If $CmdLine[0] > 0 Then $sCaption = $CmdLine[1]
If $CmdLine[0] > 1 Then $sNewFileName = $CmdLine[2]

WinWait($sCaption, "")
If Not WinActive($sCaption, "") Then WinActivate($sCaption, "")
WinWaitActive($sCaption, "")

If $sNewFileName <> "" Then
    Send($sNewFileName)
EndIf

ControlClick("Save", "", "&Save")oÝ÷ ÙK)¶¬jëh×6;Change paths and values to suite your requirements 

Dim $sHelperScript = "'G:\Scripts\Experimental\SaveAs.exe'"
Dim $sDialogCaption = "'Save Picture'"
Dim $sNewFileName = "'C:\Test\Saved.jpg'"

;Start helper script to wait for SaveAs dialog 
Run($sHelperScript & ' ' & $sDialogCaption & ' ' & $sNewFileName)

$oIE = _IECreate("http://www.ibm.com/us/images/2007/10/102207_migration_final.jpg")
_IEAction($oIE, "saveas");anything after this is stopped until you click on the Save Picture box then the script continues
;why?
MsgBox(0, "title", "Test")

You may find it easier to script the IE interface directly for the save file part of you script rather than using the IE UDF _IEAction($oIE, "saveas") function.

Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Posted

  Bowmore said:

One reason for this not working is that the execCommand() function has not been fully implemented in IE.au3 UDF _IEAction function.

The execCommand() can take 2 optional arguments for some actions SaveAs is one of these.

The second optional agrument is supposed to determine if the userinterface is displayed or not

The third optional argument is the name to save the file as.

See link for details.

http://msdn2.microsoft.com/en-us/library/ms536419.aspx

Good analysis, wrong conclusion.

The trouble is that the optional arguments for saveas were made inoperable in IE many releases ago for security reasons. The MSDN documentation has never been updted to reflect this. _IEAction, saveas does everything it can -- it just doesn't do what people want it to do.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted

  DaleHohm said:

Good analysis, wrong conclusion.

The trouble is that the optional arguments for saveas were made inoperable in IE many releases ago for security reasons. The MSDN documentation has never been updted to reflect this. _IEAction, saveas does everything it can -- it just doesn't do what people want it to do.

Dale

Thanks for that I was puzzled as to why I couldn't get it to work as documented by Microsoft. Now I know <_<

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Posted (edited)

  Bowmore said:

Thanks for that I was puzzled as to why I couldn't get it to work as documented by Microsoft. Now I know <_<

Ok fellaz, thanks for the info. I was able to get around it, but it still doesn't make sense to me.

Why doesn't this work:

_IEAction($oIE, "saveas")
Send("{TAB 2}")
Send("{SPACE}")

But this does:

MouseClick("right", 640, 512)
Send("{DOWN 6}")
Send("{ENTER}")
Send("{TAB 2}")
Send("{SPACE}")

They do the same thing, but the mouseclick works. 'Sup wit dat?

Edited by dmt740
Posted (edited)

I have had a similar issue. I used Adlibenable to click the box, then script continues.

Post the summary information of the popup box here. Using Au3Info.exe and hovering over the "OK" button.

AdlibEnable("ClickBox")

Func ClickBox()
    Opt("WinTitleMatchMode", 1)
    If WinExists("TITLE", "TEXT") Then
       ControlClick("TITLE", "TEXT", 1, "left", 1)
    EndIf
    
EndFunc   ;==>ClickBox


Func continue($img)
$img2 = StringStripWS($item, 8)
_IEImgClick($o_IE, $imglink & $img2 & ".gif", "src", 0, 0) ;This works, but then after the dialog box opens with
;an OK and Cancel button, nothing else happens. The script seems to pause and doesn't issue any commands/function 
Send("{Enter}")
$o_form = _IEFormGetObjByName($o_IE, "form1")
$o_element = _IEFormElementGetObjByName($o_form, "item")
_IEFormElementSetValue($o_element, $item)
Endfunc
Edited by Klexen
Posted

  Klexen said:

I have had a similar issue. I used Adlibenable to click the box, then script continues.

Post the summary information of the popup box here. Using Au3Info.exe and hovering over the "OK" button.

AdlibEnable("ClickBox")

Func ClickBox()
    Opt("WinTitleMatchMode", 1)
    If WinExists("TITLE", "TEXT") Then
       ControlClick("TITLE", "TEXT", 1, "left", 1)
    EndIf
    
EndFunc   ;==>ClickBox
Func continue($img)
$img2 = StringStripWS($item, 8)
_IEImgClick($o_IE, $imglink & $img2 & ".gif", "src", 0, 0) ;This works, but then after the dialog box opens with
;an OK and Cancel button, nothing else happens. The script seems to pause and doesn't issue any commands/function 
Send("{Enter}")
$o_form = _IEFormGetObjByName($o_IE, "form1")
$o_element = _IEFormElementGetObjByName($o_form, "item")
_IEFormElementSetValue($o_element, $item)
Endfunc
I wasn't exactly sure what you meant but here are screen shots of autoinfo for the Save button on the Save Picture window:

post-28478-1193754922_thumb.jpg

post-28478-1193754928_thumb.jpg

Posted (edited)

  dmt740 said:

I wasn't exactly sure what you meant but here are screen shots of autoinfo for the Save button on the Save Picture window:

If you posted the au3info from the box that pops up, then this may work... What confuses me is you mentioned that it was an "OK" or "CANCEL" box. But what you posted is a "Save" box.

AdlibEnable("ClickBox")

Func ClickBox()
    Opt("WinTitleMatchMode", 1)
    If WinExists("Save Picture", "&Save") Then
       ControlClick("Save Picture", "&Save", 1, "left", 1)
    EndIf
    
EndFunc   ;==>ClickBox
Func continue($img)
$img2 = StringStripWS($item, 8)
_IEImgClick($o_IE, $imglink & $img2 & ".gif", "src", 0, 0) ;This works, but then after the dialog box opens with
;an OK and Cancel button, nothing else happens. The script seems to pause and doesn't issue any commands/function 
Send("{Enter}")
$o_form = _IEFormGetObjByName($o_IE, "form1")
$o_element = _IEFormElementGetObjByName($o_form, "item")
_IEFormElementSetValue($o_element, $item)
EndfuncoÝ÷ ØêÓ¯&®¶­sdFÆ$Væ&ÆRgV÷C´6Æ6´&÷gV÷C² ¤gVæ26Æ6´&÷¢÷BgV÷CµvåFFÆTÖF6ÖöFRgV÷C²Â¢bväW7G2gV÷Cµ6fR7GW&RgV÷C²ÂgV÷C²gV÷C²FVà¢6öçG&öÄ6Æ6²gV÷Cµ6fR7GW&RgV÷C²ÂgV÷C²gV÷C²ÂÂgV÷C¶ÆVgBgV÷C²Â¢VæD`¢¤VæDgVæ2³ÓÒfwC´6Æ6´&÷¤gVæ26öçFçVRb33c¶Ör¢b33c¶Ös"Ò7G&æu7G&u2b33c¶FVÒÂ¥ôTÖt6Æ6²b33c¶õôRÂb33c¶ÖvÆæ²fײb33c¶Ös"fײgV÷C²ævbgV÷C²ÂgV÷C·7&2gV÷C²ÂµF2v÷&·2Â'WBFVâgFW"FRFÆör&÷÷Vç2vF£¶âô²æB6æ6VÂ'WGFöâÂæ÷FærVÇ6RVç2âFR67&B6VV×2FòW6RæBFöW6âb33·B77VRç6öÖÖæG2ögVæ7Föâ¥6VæBgV÷C·´VçFW'ÒgV÷C²¢b33c¶õöf÷&ÒÒôTf÷&ÔvWDö&¤'æÖRb33c¶õôRÂgV÷C¶f÷&ÓgV÷C²¢b33c¶õöVÆVÖVçBÒôTf÷&ÔVÆVÖVçDvWDö&¤'æÖRb33c¶õöf÷&ÒÂgV÷C¶FVÒgV÷C²¥ôTf÷&ÔVÆVÖVçE6WEfÇVRb33c¶õöVÆVÖVçBÂb33c¶FVÒ¤VæFgVæ0
Edited by Klexen

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...