Does not detect the windows
Closed this issue · 1 comments
Franjey commented
Upload windows after clicking "Upload Picture" in Instagram:
import autoit
from time import sleep
autoit.win_wait_active("Abrir", 5)
autoit.control_focus("Abrir", 1148)
sleep(2)
autoit.control_set_text("Abrir", 1148, "Text example")
autoit.autoit.AutoItError: timeout on wait for activate window
Any idea? I am running the script while the window is open.
Edit: I ran the same (ignoring the escape controls) code in SciTE editor (autoit scripting language) and works properly:
HotKeySet("^!x", "MyExit")
Local $Text = "C:\Users\Francisco\PycharmProjects\Instagram\Ipod_Touch.jpg"
; Script Start - Add your code below here
WinWaitActive("Abrir", "", 5)
; Set input focus to the edit control of Notepad using the handle returned by WinWait.
ControlFocus("Abrir", "", 1148)
; Wait for 2 seconds.
Sleep(2000)
; Send Text
ControlSetText("Abrir", "", 1148, $Text)
ControlClick("Abrir","", 1)
Func MyExit()
Exit
EndFunc ;==>MyExit
michealchew commented
Hi,
Please try to change the following line:
autoit.win_wait_active("Abrir", 5) => autoit.win_activate("Abrir")
As win_wait_active is not activating your instagram upload photo directory browsing window automatically but it is waiting for it to be active. Use win_activate to force it to be active.
Yoong Loong