I was looking for a way to compare two documents ignoring the whitespace in TextWrangler. While the interface of TextWrangler doesn't provide that option I found this https://groups.google.com/d/msg/bbedit/ER3VdOf2xOs/IcKi3ccA90oJ
Now this was not a fully working solution. While this script:
tell application "TextWrangler"
compare document 1 against document 2 options ¬
{case sensitive:true, ignore curly quotes:true, ignore extra spaces:true, ignore leading spaces:true, ignore trailing spaces:true}
end tell
works, it is somewhat inflexible. So I tried to make the second stub working:
set compOpts to {"All Options:false", "case sensitive:true", "ignore curly quotes:true", "ignore extra spaces:true", "ignore leading spaces:true", "ignore trailing spaces:true"}
tell application "TextWrangler"
tell me to set compOpts to choose from list compOpts ¬
with title "Compare Front Two Documents" with prompt ¬
"Select Options" default items (items 2 thru -1 of compOpts) ¬
multiple selections allowed true ¬
with empty selection allowed
display dialog compOpts as string
set compareOptions to make new Compare Options with properties compOpts
compare document 1 against document 2 options compareOptions
end tell
but here I get the Error:
error "TextWrangler got an error: Can’t make class Compare Options." number -2710 from Compare Options to class
what I am doing wrong here?
I want to add that the following script also works:
tell application "TextWrangler"
set compareOptions to ¬
{case sensitive:true, ignore curly quotes:true, ignore extra spaces:true, ignore leading spaces:true, ignore trailing spaces:true} ¬
compare document 1 against document 2 options compareOptions
end tell
but this doesn't work:
set compareOptions to {All Options:false, case sensitive:true, ignore curly quotes:true, ignore extra spaces:true, ignore leading spaces:true, ignore trailing spaces:true}
it just doesn't compile. What the … ?