How to reload a Safari Extension from the command line?

强颜欢笑 提交于 2019-12-05 16:38:57
Chuck

It may be that the button isn't "named" as you expect. Check out UI Browser in order to view an application's interface hierarchy for use with GUI scripting.

The "Reload" button is accessible with:

click button "Reload"  of UI element "ReloadUninstall[NAME OF EXTENSION HERE]" \
  of UI element 1 of scroll area 1 of window "Extension Builder"

Extension Browser's view hierarchy seems to have changed since the accepted answer was written. This script works for me:

tell application "System Events"
    tell process "Safari"
         click button "Reload" of UI element 0 of window "Extension Builder"
    end tell
end tell

Note that Safari and the Extension Builder window need to be open for this to work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!