autoit: run application and open file from internal menu in silent mode -
i have exe-application close , run many times in day. every time when i'm running application after started must actions: take "file" menu , take file in there.
this code worked if utilize @sw_maximize
, if run code @sw_hide
- application not started congiguraion.cfg
file
example() func example() local $ipid = run("c:\program files (x86)\server.exe", "", @sw_maximize) local $filename = "c:\program files (x86)\congiguraion.cfg" sleep(2000) send("^o") sleep(2000) send($filename) sleep(500) send("{enter}") endfunc ;
i want create exe-file , set in scheduler trigger: begin task @ startup. that's why need run in silent mode.
p.s.
also changed program:
example() func example() run("c:\program files (x86)\server.exe") local $hwnd = winwaitactive("server") sleep(2000) controlsend($hwnd, "", "", "^o") sleep(2000) controlsend($hwnd, "", "", "c:\program files (x86)\congiguraion.cfg{enter}") endfunc ;
this solution doesn't work if tried run @sw_hide key or on hidden mode in scheduler.
there function called controlsend. if u want utilize it, suggest utilize 'autoit window info" installed usual autoit installation. tool got run programm , command names/ids , fill function.
if have questions how controlsend excatly works sense free inquire :)
example() func example() run("notepad","") local $hwnd = winwaitactive("unbenannt - editor") winsetstate($hwnd,"", @sw_hide ) controlsend($hwnd, "", "", "sample text") controlsend($hwnd, "", "", "^o") controlsend($hwnd, "", "", "mytext.txt{enter}") winsetstate($hwnd,"", @sw_show ) endfunc ;
autoit mode silent
No comments:
Post a Comment