on isDebuggingEnabled()
if id of current application begins with "com.latenightsw.ScriptDebugger" then
tell current application
tell (first document whose (name is (my name) or name begins with ((my name) & ".")))
return its debugger enabled
end tell
end tell
end if
return false
end isDebuggingEnabled
isDebuggingEnabled()