tell application "Script Debugger"
set theDoc to document 2
set allhandlerNames to the name of every script handler of theDoc
set handlerName to some item of allhandlerNames
set theParams to (variable name of handler parameters of script handler handlerName of theDoc)
end tell
After some investigations, I think I have isolated the problem:
SD is freezing when the parameters of an handler are values (numbers, strings, lists…) or when the parameters declaration contains double-quotes or parenthesis.
Here are some examples:
--> examples of handler syntax that will return the variable names
on |set the future|:wString paramA:wA paramB:wB
display dialog wString & return & wA & return & wB
end |set the future|:paramA:paramB:
on testA:wString paramA:wA paramB:wB
display dialog wString & return & wA & return & wB
end testA:paramA:paramB:
on testB:true paramA:false paramB:(missing value)
display dialog wString & return & wA & return & wB
end testB:paramA:paramB:
on testC()
display dialog "Hello"
end testC
on testD(wString, wA, wB)
display dialog wString & return & wA & return & wB
end testD
on testE(true, false, missing value)
display dialog wString & return & wA & return & wB
end testE
--> examples of handler syntax that will freeze SD8
to testM:""
display dialog "Hello"
end testM:
on testN:{wString, wA, wB}
display dialog wString & return & wA & return & wB
end testN:
on testO(wString, {wA, wB})
display dialog wString & return & wA & return & wB
end testO
on testP(true, false, "")
display dialog wString & return & wA & return & wB
end testP
on testQ(true, false, 1)
display dialog wString & return & wA & return & wB
end testQ
[These handlers are not meant to be executed. They are simply used to test this command: get variable name of handler parameters of script handler theHandler of theDoc.]