两年前的东西了,要不是现在 GFW 这么牛逼估计一辈子都用不到。
新建 AppleScript,贴入代码:
on idle tell application "System Events" tell current location of network preferences set myConnection to the service "YOUR VPN NAME" if myConnection is not null then if current configuration of myConnection is not connected then connect myConnection end if end if end tell return TIME end tell end idle
在第四行的 YOUR VPN NAME
中键入你要连接的VPN名称,在倒数第三行的 TIME
中键入检测时间,例如五秒就是 5
。
保存为应用程序,并勾选运行处理程序后保持打开
。
由于这个 AppleScript 应用会一直在你的 dock 上显示,默认图标太丑了,我给换了一个图标:
这样看上去就好多了。