>>338
スレチだが、あくまでも部品として色々な調整(AppleScript/GUI Scriptingはタイミングが合わなとかあるときはある)などは自分でやろう
set userAgent to "Mozilla/5.0 (iPhone; CPU iPhone OS 13 like Mac OS X)"
tell application "Safari"
set theURL to URL of front document
make document
end tell
tell application "System Events" to tell process "Safari"
set frontmost to true
click menu item "Other…" of menu "User Agent" of menu item "User Agent" of menu "Develop" of menu bar item "Develop" of first menu bar
tell first sheet of front window
set value of first text area of first scroll area to userAgent
click button "OK"
end tell
end tell
tell application "Safari" to set URL of front document to theURL
