0

マシンにインストールされているソフトウェアを自動化したい。AutoIt を使用していますが、ある画面でコントロール ID またはタイトルを取得できなかったため、そのコントロールにアクセスしてその中のテキストを見つけることができませんでした。そのテキストをクリックしたいので、そのテキストの座標が必要です。C#コードまたは他のサードパーティツールを使用してそのテキストを調整するにはどうすればよいですか? 私はグーグルでチェックしましたが、興味深いものや役立つものは何も得られませんでした. この問題に関連することは大歓迎です。

4

1 に答える 1

0

他の人が言ったように、あなたの質問は少しあいまいです。どのような種類のソフトウェアを自動化しようとしていますか? 何をより正確に自動化したいですか? (マウス操作? クリック? ソフトウェアの特別な何か? ..)

たとえば、マウスのクリックに関しては、プロセスを自動化する主な方法が 2 つあります。画面座標ベースのクリックまたはウィンドウ座標ベースのクリックです。以下に、 「Web プラットフォーム インストーラー 5.0」 (Microsoft の Web サイト @ https://azure.microsoft.com/en-us/tools/からダウンロードできる) から特定のアプリのインストールを自動化する例を示します。 >ビジュアルスタジオ 2015)

;Gives Admin rights to autoIT
#RequireAdmin
;launches the program in the same directory as the installer
Run(@ScriptDir & '\azure.exe')
;Sets the coordinates as window coordinates with "0" (VS screen coordinates) 
AutoItSetOption('MouseCoordMode',0)
;Waits for the program to open and to display a text like "Microsoft Web Platform Installer"
WinWait("Web Platform Installer 5.0","Microsoft Web Platform Installer")

;wait 1.5 seconds
sleep(1500)
;When the window is visible, le cursor is set as active ont that window (IMPORTANT)

WinActivate("Web Platform Installer 5.0")
;the following commands are mouseclicks on specific boxes of the program to automate specific installs on the installer
;MouseClick('primary', x, y, 1, speed (1 to 10))
; You will find those coordinates in the "AU3info.exe file" after you've installed autoIT ( Au3info allows to find coordinates
; by targeting specific places on a window)
MouseClick('primary', 155, 60, 1, 10)
sleep(1500)
;selects 4 apps to be installed (4 installs), clics INSTALL and waits 1.5 sec
MouseClick('primary', 817, 122, 1, 10)
MouseClick('primary', 821, 163, 1, 10)
MouseClick('primary', 815, 401, 1, 10)
MouseClick('primary', 828, 519, 1, 10)
MouseClick('primary', 692, 587, 1, 10)
sleep(1500)
;Prepaing the install and waiting till a text like "Review the following list" apprears
WinWait("Web Platform Installer 5.0","Review the following list")
WinActivate("Web Platform Installer 5.0")
sleep(1500)
MouseClick('primary', 43, 350, 1, 10)
MouseClick('primary', 603, 433, 1, 10)
;starts the installation and waits till the installation is finished (when "The following"..programm has installed ..blabla
WinWait("Web Platform Installer 5.0","The following")
MouseClick('primary', 612, 434, 1, 2)
;gets rid of some issues stemming from microsoft edge (the send functions allows to send keyboard keys (like ESC, SPACE, ALT, etc..))
sleep(1000)
Send("{ENTER}")
MouseClick('primary', 612, 434, 1, 2)
sleep(1000)
Send("{ENTER}")
;quits all the windows with ALT + F4
WinWait("Web Platform Installer 5.0")
WinActivate("Web Platform Installer 5.0")
Sleep(1000)
Send("{ALT down}{F4 down}{F4 up}{ALT up}")
Sleep(1000)
Send("{ALT down}{F4 down}{F4 up}{ALT up}")
于 2016-08-29T14:53:54.237 に答える