Env
- macOS 13.2.1 (22D68)
- BTT 4.028
Problem
I have button with apple script widget for control VPN State
-- SET YOUR CONFIG NAME BELOW
set tunnelBlickConfigName to "YOUR_VPN_NAME"
tell application "Tunnelblick"
set vpnState to get state of first configuration where name = tunnelBlickConfigName
if vpnState = "CONNECTED" then
return vpnState
end if
return "OFF"
end tell
this code run every 5 sec and result is EMPTY, but when I run this code in Apple Script editor, result is OK.
Also i have Actions assigned to this button.
-- SET YOUR CONFIG NAME BELOW
set tunnelBlickConfigName to "YOUR_VPN_NAME"
tell application "Tunnelblick"
set vpnState to get state of first configuration where name = tunnelBlickConfigName
if vpnState = "CONNECTED" then
disconnect tunnelBlickConfigName
end if
if vpnState ≠ "CONNECTED" then
connect tunnelBlickConfigName
end if
end tell
result aslo EMPTY, but in Apple Script all works fine.