Jump to content

Recommended Posts

Posted

I want to upload a file thru Autoit. After I click on the Browse-button it opens the 'Choose File to Upload'-window. For some reason the script doesn't continu after opening the 'Choose File to Upload'-window. It won't paste the contents of the clipboard.

#include <GUIConstants.au3>
#include <IE.au3>
$GUI = GUICreate($protitle, 1024, 800)
$object = ObjCreate("Shell.Explorer.2")

_IENavigate($object, "http://somesite.com")
_IELoadWait($object)

$oinput = _IEGetObjByName($object, "userfile")
_IEAction($oinput, "click")
_IELoadWait($object)

Send("{CTRLDOWN}v{CTRLUP}")

Does anyone know what's wrong?

Posted

I don't see a reason to call _IELoadWait at all here... _IENavigate() calls is automatically and it won't have any effect after the click action because the page is already loaded (the script would just continue).

ClipGet() will retrieve the clipboard text btw...

Maybe try just a sleep(2000) after _IEAction($oinput, "click"), and then a Send(ClipGet()) to see if it does what you'd expect...

Posted

See the "Automate input type=file" link in my sig.

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

I don't see a reason to call _IELoadWait at all here... _IENavigate() calls is automatically and it won't have any effect after the click action because the page is already loaded (the script would just continue).

ClipGet() will retrieve the clipboard text btw...

Maybe try just a sleep(2000) after _IEAction($oinput, "click"), and then a Send(ClipGet()) to see if it does what you'd expect...

That doesn't work either. It just doesn't paste anything.

Posted

See the "Automate input type=file" link in my sig.

Dale

Thanks, I tried that, but it doesn't work either. What I noticed is that it doesn't recognize the "Choose File to Upload"-window. WinGetPos("Choose File to Upload") returns nothing. The weird thing is that the window-title is the same as Au3Info.exe returns. Any idea what else to try?

  • 4 years later...

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...