SD8 Enhancement Request - Option to escape tabs & linebreaks in strings, separate from View > Show Invisibles

Hi Mark (and friends) – first of all, since I have not had the opportunity to say it before, thank you for all the fantastic work you have done on SD over the years. I’ve been using it almost daily since version 5. My Macs would not be the same without it!

One thing I would really like to see in SD is the option to show the escaped “\t”, “\n”, and “\r” in strings (alone), similar to the option present in Apple’s Script Editor.

I realize that SD has View > Show/Hide Invisibles, which is useful in its own right, but the use case for the above is quite different. In string-heavy scripts, it often becomes difficult to read multi-line string literals, and line wrapping makes indentation levels difficult to parse visually. I often resort to concatenating string literals with e.g. linefeed to make this easier to read.

As a trivial example, compare the following for legibility:

# Script Debugger view
tell application "xyz"
    if some_condition then
        processSomething()
        display dialog "Finished processing.

Press OK to exit."
    end
end

versus

# Script Editor, with "escaping tabs and line breaks in strings" checked
tell application "xyz"
    if some_condition then
        processSomething()
        display dialog "Finished processing.\n\nPress OK to exit."
    end
end

I personally find the latter much easier to read. With the former, even choosing to “Show Invisibles” in SD does not change the fact that the string is still breaking across lines & making it difficult to parse the indentation level (and Showing Invisibles arguably makes it even harder to read). With longer strings, this is even more pronounced.

An option to escape tabs and line breaks in strings could co-exist with the toggle to Show Invisibles, and wouldn’t have to interfere with one another.

I hope I’ve explained my reasoning sufficiently for you to give this some serious consideration. Thanks again!

Option in Apple’s Script Editor: