Posts

Post not yet marked as solved
7 Replies
Here's a more simple way of doing it - reference elements by name instead of by location:tell application "System Events" tell application "Safari" to activate delay 1 tell process "Safari" -- check if developer menu is available set menuItems to name of every menu bar item of menu bar 1 if "Develop" is not in menuItems then error "You must enable developer menu" number -1024 -- click to allow js events click menu item "Allow JavaScript from Apple Events" of menu 1 of menu bar item "Develop" of menu bar 1 -- confirm allow if value of static text 1 of window 1 is "Are you sure you want to allow JavaScript from Apple Events?" then click button "Allow" of window 1 end tell end tell