Что нового

[Окна, Диалоги] Установка значения input type=file

Kelter

Новичок
Сообщения
1
Репутация
0
Пытаюсь установить элемент выбора файла на свое значение, нашел старый пример с офф. сайта, но он не работает. Подскажите, в чем может быть проблема.
Код:
; *******************************************************
; Example 5 - Set the value of an INPUT TYPE=FILE element
;               Same as previous example, but with invisible window
;               (security restrictions prevent using _IEFormElementSetValue)
; *******************************************************
;
#include <IE.au3>

$oIE = _IE_Example("form")

; Hide the browser window to demonstrate sending text to invisible window
_IEAction($oIE, "invisible")

$oForm = _IEFormGetObjByName($oIE, "ExampleForm")
$oInputFile = _IEFormElementGetObjByName($oForm, "fileExample")

; Assign input focus to the field and then send the text string
_IEAction($oInputFile, "focus")
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "C:\myfile.txt")

MsgBox(0, "Success", "Value set to C:\myfile.txt")
_IEAction($oIE, "visible")
 
Верх