0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

退屈なことはAppleScriptにやらせよう

Posted at

ネットワークの詰まりが酷くNATテーブルのクリアを何度もするのがひどく面倒だったのでショートカットを作成した。我が家のHome5Gとかいう:wastebasket:がターゲットだ。

ショートカットから+ボタンを押して、AppleScriptを実行。

tell application "Safari"
	activate
	open location "http://192.168.128.1"
	delay 3.5

	do JavaScript "document.querySelector('.login-button').click();" in current tab
	delay 1

	do JavaScript "document.getElementById('password').value='パスワード';" in current tab

	do JavaScript "document.getElementById('submit').click();" in current tab
	delay 3

	open location "http://192.168.128.1/mifi-router_settings_nat_settings.html"
	delay 2

	do JavaScript "document.getElementById('upnp_lock').click();" in current tab
end tell

スクリーンショット 2024-11-19 13.37.02.png

出来た。
これで実行すれば、Safariが立ち上がりルーターのコンソール開いてログインしてNATの設定再適用をササッとやっててくれるゾ。

こんなことしない生活が送りたい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?