I'm curious about the javascript enable/disable Apple script in the safari 17 version

With the update to Safari 17, the JavaScript button is no longer available in the developer menu.

Can I press JavaScript active and inactive with Apple Script?

Thank you in advance :pray:

The language is different, but it’s the setting in the picture. :grinning:

Thank you so much for your reply.

But I’m a beginner who doesn’t know Apple scripts well, so it’s hard to understand the answer :sob:

Can you tell me a little bit more?

on run
tell application “Safari”
activate
if JavaScript is true then
set JavaScript to false
else
set JavaScript to true
end if
end tell
end run

Thank you for your answer :pray:
Is the apple script written above wrong?

**error "2024-02-03 21:11:57.688 defaults[22044:1016560] **
The domain/default pair of (/Users/greedist/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari, WebKitJavaScriptEnabled) does not exist" number 1

Thank you for the detailed answer :grinning:
I tried running the script as you wrote, but the error message like the above is output.
Is there a solution?

Thank you so much for the detailed answers :slightly_smiling_face:

Have a good day!