有时我使用PdaNet使用我的iPhone系绳.OSX的桌面客户端不像Windows的桌面客户端那么丰富.其中一个主要区别是OSX不允许在插入后立即自动连接到iPhone.
您是否知道使用Applescript单击菜单栏上的PdaNet图标然后选择并单击其上的"连接"选项?
以下是'PdaNetMac'应用程序的菜单栏图标:

我看了下面的问题,但我是一个苹果新手,不知道如何在菜单栏上搜索PdaNet的图标:
我已确认已启用"为辅助设备启用访问".
根据上面的第二个问题,这是我目前的尝试:
ignoring application responses
tell application "System Events" to tell process "PdaNet"
click menu bar item 1 of menu bar 2
end tell
end ignoring
do shell script "killall System\\ Events"
delay 0.1
tell application "System Events" to tell process "PdaNet"
tell menu bar item 1 of menu bar 2
click menu item "Connect" of menu 1
end tell
end tell
Run Code Online (Sandbox Code Playgroud)
有趣的是,当我改变时,上面的脚本对我很有PdaNet用Flux.
谢谢!!
你非常接近!!
我刚刚下载了PdaNet应用程序来测试它,我必须对你的脚本进行的唯一编辑是更改PdaNet为'PdaNetMac`(我以为这是进程名称,因此使用了Activity Monitor中显示的进程名称).
这对我有用:
ignoring application responses
tell application "System Events" to tell process "PdaNetMac"
click menu bar item 1 of menu bar 2
end tell
end ignoring
do shell script "killall System\\ Events"
delay 0.1
tell application "System Events" to tell process "PdaNetMac"
tell menu bar item 1 of menu bar 2
click menu item "Connect" of menu 1
end tell
end tell
Run Code Online (Sandbox Code Playgroud)
希望这也适合你!
(非常有用的脚本,顺便说一句.干杯!)
| 归档时间: |
|
| 查看次数: |
4007 次 |
| 最近记录: |