AppleScript名:VPN経由のネットワーク接続を切断する |
— Created 2017-09-30 by Takaaki Naganoya — 2017 Piyomaru Software tell application "System Events" tell current location of network preferences set sList to every service whose kind is 13 and active is true –種別がVPNのNetwork Serviceで状態がactive(接続中)のものを取得 if sList = {} then return false if length of sList is not equal to 1 then –複数VPNが存在している場合にはユーザー選択 set ssRes to choose from list sList if ssRes = false then return false set sRes to first item of ssRes else set sRes to first item of sList end if disconnect sRes end tell end tell |
More from my site
(Visited 165 times, 1 visits today)