I started making some small changes to this script today, and ended up adding/changing so much that it's almost a new/separate script in the end.
I'm not sure what to do with this new version, since some of the changes I wanted may not be wanted by everyone, while other changes are definite improvements and would make sense to merge back into the "official" version. I'll upload it here and let AussieBoykie decide which changes, if any, he wants to keep.
I've used "2.2 LDx" as the version string, since it's based on 2.2 from the root post.
2.2 LD3: Beyond Compare.osp (14.4 KB)
History of my edits:
- 16 November 2023 ("2.2 LD3"):
- Fixed problem with files that have plugin-archive extensions but aren't really archives.
- 24 August 2020 ("2.2 LD2"):
- Small change to add a
NEWWINDOW
argument (passes/solo
switch to make BComp.exe open a new window). - Also updated the default/fallback path for Beyond Compare 4.
- Small change to add a
- 19 November 2019:
- Fixed an issue with very high DPIs and/or the large icon size.
- 12th October 2017:
- Updated .osp to include high DPI icons.
Here's a summary of what I changed from the original 2.2 in the root post:
-
Requires Directory Opus 11.4 or above.
-
Ensures left and right in Beyond Compare match the left and right in Opus (even if the right is the source).
-
Allows comparing folders with archives (since BC supports this), with a new config option to disable it. (Disabling it also requires you to make changes to BC's own config, to stop it treating archives as folders.)
-
If one item is selected in the source and nothing (or the wrong kind of thing, or too many things) in the dest, it now ignores the destination selection(s) and compares the selected source item on both sides.
For example, if
C:\
andD:\
are the source/dest folders, andFile.txt
is selected in the source,C:\File.txt
andD:\File.txt
are compared."Wrong kind of thing" means a file on one side and a folder on the other. (Where archives are considered folders, if that option is enabled.)
-
Fix for when Desktop is compared to another folder. (Compares
/desktopdir
instead of/desktop
virtual folder.) -
Gets default Beyond Compare exe path from the registry if the script config has no path or has a path that doesn't exist.
Failing that, it uses the standard Beyond Compare install path, under the 32-bit Program Files folder.
Default config path is now blank, and should only be set if the above methods need to be overridden.
-
Shows an error message if Beyond Compare exe isn't found.
-
If the path found/configured is for BCompare.exe, it will swap it for BComp.exe (if it exists).
Using BComp.exe is preferable as it will open new tabs in an existing BC instance. (Could make this an option.)
-
Won't do anything if nothing is to be compared.
(If people want the button to be able to run BC on its own, it could be a config option. For me it'd just mean having to close BC if I clicked in error, so I added the check.)
(You can still click the button with nothing selected to launch BC against the source and destination folders, so it's still easy to quickly launch BC.)
-
Won't do anything if either thing to be compared does not exist. (This is mainly for the new case where you can select a file on one side to compare the same thing on both sides.)
-
New small icon matching the 22x22 size of Opus's other small toolbar icons, with 1 pixel padding.
(Made by resizing the 32x32 icon to 20x20, then adding 1 pixel of padding on all sides, to match the standard icons.)
(2017: Now also includes high DPI icons.)
-
Removed debug stuff I didn't need and tidied up some of the code, although in the end it's almost a re-write after adding all of the above.
-
Changed command name from
$BC
toBeyondCompare
. (Change it back if you want; I just didn't like it.) Also changed the description and label to work better with where they are displayed.