scripts:autoit
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версия | ||
scripts:autoit [12.09.2017 06:54] – viacheslav | scripts:autoit [30.07.2024 19:21] (текущий) – внешнее изменение 127.0.0.1 | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
+ | ===== Нажатие кнопок в 1С ===== | ||
+ | С простейшим графическим интерфейсом. | ||
+ | {{: | ||
+ | |||
+ | <code autoit> | ||
+ | #include < | ||
+ | |||
+ | Opt(' | ||
+ | |||
+ | MainGUI() | ||
+ | |||
+ | Func MainGUI() | ||
+ | Local $Button1, $Button2, $Button3, $Button4, $msg | ||
+ | GUICreate(" | ||
+ | |||
+ | Opt(" | ||
+ | |||
+ | $Button1 = GUICtrlCreateButton(" | ||
+ | $Button2 = GUICtrlCreateButton(" | ||
+ | $Button3 = GUICtrlCreateButton(" | ||
+ | $Button4 = GUICtrlCreateButton(" | ||
+ | |||
+ | GUISetState() | ||
+ | |||
+ | ; Run the GUI until the window is closed | ||
+ | While 1 | ||
+ | $msg = GUIGetMsg() | ||
+ | Select | ||
+ | Case $msg = $GUI_EVENT_CLOSE | ||
+ | | ||
+ | Case $msg = $Button1 | ||
+ | Run ( '" | ||
+ | WinWait (" | ||
+ | Sleep (3000) | ||
+ | WinActivate (" | ||
+ | Send ("{F6 2}") | ||
+ | Send (" | ||
+ | Sleep (2000) | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep (1000) | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep (1000) | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Case $msg = $Button2 | ||
+ | for $i=1 to InputBox("", | ||
+ | WinActivate (" | ||
+ | ; Взять наряд в работу | ||
+ | Send (" | ||
+ | Send ("{TAB 10}") | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | ; Пометить наряд выполненным | ||
+ | WinActivate (" | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | ; Закрыть | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep ( 3000 ) | ||
+ | next | ||
+ | Case $msg = $Button3 | ||
+ | WinActivate (" | ||
+ | ; Взять наряд в работу | ||
+ | Send (" | ||
+ | Send ("{TAB 10}") | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | ; Пометить наряд выполненным | ||
+ | WinActivate (" | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | ; Распечатать сервисную заявку | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | WinActivate (" | ||
+ | Send (" | ||
+ | Case $msg = $Button4 | ||
+ | for $i=1 to InputBox("", | ||
+ | WinActivate (" | ||
+ | ; Взять наряд в работу | ||
+ | Send (" | ||
+ | Send ("{TAB 10}") | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | ; Пометить наряд выполненным | ||
+ | WinActivate (" | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | ; Распечатать сервисную заявку | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep ( 5000 ) | ||
+ | WinActivate (" | ||
+ | Send (" | ||
+ | ; Закрыть | ||
+ | Send (" | ||
+ | Send (" | ||
+ | Sleep ( 3000 ) | ||
+ | next | ||
+ | EndSelect | ||
+ | WEnd | ||
+ | EndFunc | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// |