![デスクトップレイアウトの開き方を自動化するにはどうすればよいですか?](https://rvso.com/image/1288731/%E3%83%87%E3%82%B9%E3%82%AF%E3%83%88%E3%83%83%E3%83%97%E3%83%AC%E3%82%A4%E3%82%A2%E3%82%A6%E3%83%88%E3%81%AE%E9%96%8B%E3%81%8D%E6%96%B9%E3%82%92%E8%87%AA%E5%8B%95%E5%8C%96%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
毎日、たくさんのプログラムを開いて、自分にとって一番使いやすいように並べ替えてから仕事に取り掛かります。モニターは2台あり、現在使用しているアプリはPuTTY(*2)、pycharm、Winamp、Chrome、Perforceです。
これらのアプリケーションの起動、配置、サイズ設定を保存 (またはプログラム) して、手動で何度も繰り返さなくても済むようにするにはどうすればよいでしょうか?
答え1
以下はサンプルコードですオートイットこれにより、Chrome と Putty が起動し、それらの位置が変更され、サイズが変更され、PuTTY を開くと SSH サーバーに自動的にログインします。これはまさにあなたが望むものではないかもしれませんが、残りの部分を埋めるための基本的な構成要素が提供されます。
$server = "xxx.xxx.xxx.xxx"
$username = "myusername"
$password = "mypassword"
ShellExecute(@userprofiledir & "\AppData\Local\Google\Chrome\Application\chrome.exe", "google.com") ;open chrome window to google.
WinWait("Google", "") ;waits for window to be open
WinMove("Google", "", 1, 1, 800, 600) ;moves window to 1x1 and then resizes it to 800x600
Run(@ComSpec & " /c " & '""C:\Program Files\PuTTY\putty.exe"" -ssh ' & $username & '@' & $server & ' -pw ' & $password, "", @SW_HIDE) ;opens putty and logs into ssh server automatically
WinWait($server, "") ;waits for window to be open
WinMove($server, "", 801, 1, 600, 1000) ;moves window to 801x1 and resizes to 600x1000