TextWrangler의 공백을 무시하고 두 문서를 비교할 방법을 찾고있었습니다. TextWrangler의 인터페이스가이 옵션을 제공하지는 않지만 https://groups.google.com/d/msg/bbedit/ER3VdOf2xOs/IcKi3ccA90oJTextWrangler : AppleScript로 공백을 무시한 두 문서 비교
이제는 완전히 작동하는 해결책이 아니 었습니다. 이 스크립트는 다음과 같습니다 :
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
작품은 다소 유연하지 않습니다. 그래서 나는 두 번째 스텁 작업 만들려고 :
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
을 그러나 여기에서 나는 오류를 얻을 : 내가 잘못 여기서 뭐하는 거지
error "TextWrangler got an error: Can’t make class Compare Options." number -2710 from Compare Options to class
?
나는 다음 스크립트는 작동 추가 할 :
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
하지만이 작동하지 않습니다
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}
그냥 컴파일되지 않습니다. 뭐야 ...?
코드는 매력처럼 작동합니다. 그래서 내가 아는 중요한 점은 옵션의 문자열 표현을 TextWrangler의 Compare Options 클래스로 변환 할 수 없다는 것입니다. 당신의 대답이 좋기 때문에 나는 그것을 투표하고 싶습니다. 그러나 그렇게 할 평판이 없어서 미안 해요! –