Sto cercando aiuto per correggere questo errore:
error "System Events got an error: Can’t get menu item \"Clear History...\" of menu \"Safari\" of menu bar 1 of process \"Safari\"." number -1728 from menu item "Clear History..." of menu "Safari" of menu bar 1 of process "Safari"
Il mio codice è:
tell application "Safari"
launch
activate
if not (exists document 1) then
make new document at front
end if
end tell
delay 1
tell application "System Events"
keystroke "e" using {option down, command down}
tell process "Safari"
tell menu bar 1
tell menu "Safari"
tell menu item "Clear History..."
click
every UI element
end tell
end tell
end tell
tell window 1
tell sheet 1
tell button "Clear History"
click
end tell
end tell
end tell
tell menu bar 1
tell menu bar item "Develop"
tell menu 1
click menu item "Empty Caches"
end tell
end tell
end tell
end tell
end tell