Comparing scripts

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jmk_phd
Posts: 217
Joined: Sat Apr 15, 2017 8:29 pm

Comparing scripts

Post by jmk_phd » Tue Aug 19, 2025 1:59 am

Hi all --
Some time ago I duplicated a button with a 1725-line script in order to test, catch, and correct any errors. Unfortunately, I did not keep good notes on the corrections made to the copy. After spending some time comparing the scripts line-by-line -- thanks to having learned from forum members that a script could be opened in a new window, so two scripts could be viewed side-by-side -- I recalled that the BBEdit app had a "Find Differences..." feature that required only saving each version of the script as a text file, then opening these in BBEdit. Within a few seconds I found 8 changes I'd overlooked in my first tedious line-by-line comparison, so it was very easy to reconcile the two versions of the script.

Perhaps I've missed that there is some comparison feature in LiveCode (at least prior to the new AI version that I don't need and can't afford) that does the same. Otherwise, I recommend using at least the free version of BBEdit in order compare and reconcile scripts.

jeff k

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 325
Joined: Sat Aug 16, 2008 9:48 am
Contact:

Re: Comparing scripts

Post by SWEdeAndy » Tue Aug 19, 2025 6:53 am

Check diffCompare in the Dictionary and see if that helps?
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: Comparing scripts

Post by bn » Tue Aug 19, 2025 10:07 am

Hi,

I made a stack to compare versions of a script. It uses diffCompare and is not polished since it is mostly for private use.
It lists the diffences in gitHub style, clicking on a "difference" hilites the difference and scrolls them into view. You can paste the scripts into the fields or load two text files to make a diff.

Kind regards
Bernd
Attachments
Find Differences in code_0.3 2.livecode.zip
(6.69 KiB) Downloaded 4 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10102
Joined: Fri Feb 19, 2010 10:17 am

Re: Comparing scripts

Post by richmond62 » Tue Aug 19, 2025 11:03 am

I have had a long-term love affair with BBEdit since about 2000; mind you that did involve their TextWranger for a bit.

stam
Posts: 3081
Joined: Sun Jun 04, 2006 9:39 pm

Re: Comparing scripts

Post by stam » Tue Aug 19, 2025 11:09 am

Also a good reason to use version control systems like git/github.
Not only can you roll back any version, but using scriptonlystacks/text files, it will show a diff for each incremental version.

Post Reply