Re: Compare two AppleScripts
Re: Compare two AppleScripts
- Subject: Re: Compare two AppleScripts
- From: Shane Stanley <email@hidden>
- Date: Sat, 28 Apr 2018 09:29:49 +1000
On 28 Apr 2018, at 8:09 am, Gil Dawson <email@hidden> wrote:
>
> I'd like a script, though.
FWIW, this is what I use:
try
tell application "Script Debugger"
set script2 to (source text of document 2) as text
set script1 to (source text of document 1) as text
end tell
on error -- not two scripts open
beep
end try
tell application "BBEdit"
make new text window with properties {contents:script2}
make new text window with properties {contents:script1}
set theDiff to compare text window 1 against text window 2 options
{case sensitive:true, ignore leading spaces:true, ignore trailing spaces:true,
ignore extra spaces:false}
beep
set foundDiff to differences found of theDiff
end tell
if foundDiff is false then
tell application "BBEdit"
set theReason to reason for no differences of theDiff
close text window 1 saving no
close text window 1 saving no
end tell
tell application "Script Debugger"
activate
with timeout of 100000 seconds
display dialog "No differences found. (" & theReason &
")" buttons "OK" default button 1
end timeout
end tell
end if
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden