set theText to the clipboard as text
set {saveTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {"\\"}}
set theText to text items of theText
set AppleScript's text item delimiters to {"\\\\"}
set theText to theText as text
set AppleScript's text item delimiters to {"\""}
set theText to text items of theText
set AppleScript's text item delimiters to {"\\\""}
set theText to theText as text
set AppleScript's text item delimiters to saveTID
tell application id "com.latenightsw.ScriptDebugger7" -- Script Debugger.app
tell document 1
set selection to theText
end tell
end tell
tell application "Script Debugger"
set myText to the selection of window 1
end tell
set myList to paragraphs of myText
repeat with x from 1 to count of myList
set thisGraph to item x of myList
set item x of myList to EscapeQuotes(thisGraph)
end repeat
set AppleScript's text item delimiters to {", ¬" & return}
set newText to myList as text
set newText to return & "{ ¬" & return & newText & "}"
tell application "Script Debugger"
set the selection of window 1 to newText
end tell
on EscapeQuotes(theText)
set {saveTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {"\\"}}
set theText to text items of theText
set AppleScript's text item delimiters to {"\\\\"}
set theText to theText as text
set AppleScript's text item delimiters to {"\""}
set theText to text items of theText
set AppleScript's text item delimiters to {"\\\""}
set theText to theText as text
set AppleScript's text item delimiters to saveTID
return "\"" & theText & "\""
end EscapeQuotes