参考 :
https://www.jianshu.com/p/17e93d03e8b9
https://www.jianshu.com/p/68b1cef4156f
https://blog.51cto.com/6095891/2160009
on run {input, parameters}
(* Your script goes here *)
display dialog "请输入用户名:" default answer ""
set username to the result
set nickname to the text returned of username
get nickname
display dialog "请输入密码:" default answer ""
set passssord to the result
set pass to the text returned of passssord
get pass
do shell script "route add -net 1.0.0.0 -netmask 255.255.255.0 2.0.0.0" user name nickname password pass with administrator privileges
return input
end run
1.0.0.0 是内网目标地址
255.255.255.0 是内网目标地址子网掩码
2.0.0.0 是内网目标地址网关
END。