• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Compare two AppleScripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Compare two AppleScripts
      • From: Gil Dawson <email@hidden>
References: 
 >Compare two AppleScripts (From: Gil Dawson <email@hidden>)

  • Prev by Date: Re: Compare two AppleScripts
  • Next by Date: Re: Compare two AppleScripts
  • Previous by thread: Re: Compare two AppleScripts
  • Next by thread: Re: Compare two AppleScripts
  • Index(es):
    • Date
    • Thread