The dictionary entry for Script Debugger’s script handler’s “source text” says it’s settable, but the script below fails with the error:
“Error: set to failed due to an access violation (errAENotModifiable:-10003)”
tell application "Script Debugger"
set targetDoc to document "some script with handlers" -- succeeds
set aHandler to first script handler of targetDoc -- succeeds
get source text of aHandler -- succeeds
set source text of aHandler to "new stuff" -- fails
end tell
What am I doing wrong? I can set the source text of the document, but not of a handler.