Announcement

Collapse
No announcement yet.

Copy only files with important differences

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy only files with important differences

    I want to compare 2 directories and ZIP left-side differences. I tried with this script:

    criteria rules-based
    load %1 %2
    expand all
    select lt.diff
    copyto lt path:base Diff.zip

    But it also copies files with unimportant differences. How can I copy only files with important differences?

  • #2
    Personally I think the select command should have an option for important differences in the scripting reference such as:

    select lt.important

    But it doesn't. One way to ensure that a the script always ignores unimportant differences would be to create and save a named folder compare session in the GUI with the ignore unimportant differences option enabled, then, in your script, load the session by name rather than loading the left and right paths.
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

    Comment


    • #3
      @Michael: I also thought about this suggestion but help/Scripting Reference/Load says:
      · Loading a session causes all that session's settings, except the display filter (show all, only mismatches, only matches, etc.), to be used.
      and Ignore Unimportant Differences is a display filter!

      @Scooter: I think scripting/select-command needs another option:
      diff[all|.important|.unimportant] By default, all is used.

      @David: If this option is available in a future version of BC3, your script should look like that:
      criteria rules-based
      load %1 %2
      expand all
      select lt.diff.important
      copyto lt path:base Diff.zip
      if you don't use a saved session.

      Greetings Lutz
      Last edited by Lutz; 08-May-2009, 04:34 AM.

      Comment


      • #4
        Ignore unimportant is most definitely not a display filter! It changes what's considered a difference, so it affects the display filter, but it also affects coloring and the "goto next difference" command.

        I'll see what's involved in adding both explicit "select" support and/or adding some sort of explicit "ignore unimportant" command.
        Zoë P Scooter Software

        Comment


        • #5
          If Ignore Unimportant Differences isn't a display filter, will its state being used when loading a saved session from a script? The help only excludes display filter.
          If so, Michaels suggestion should work!?

          Comment


          • #6
            Yes, if "Ignore Unimportant Differences" is set in a saved session the script will respect it, and Michael's suggestion will work.
            Zoë P Scooter Software

            Comment


            • #7
              Thanks to all!

              I am using BC 2.4.1 and as Lutz mentioned, loading a session does not help since display filters are not loaded.

              I really need to be sure the flag is set, so I will change the registry entry (I know is quite radical but it works):

              [HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare\FolderViewer]
              "SimilarAreExact"=dword:00000001

              before calling BC

              Comment


              • #8
                Ahh, very sorry about misleading you, David. I didn't realize this was in the BC2 forums. Loading a saved session will work in BC3, but I think setting turning it on globally like you're doing is the onlly way to do it in BC2.
                Zoë P Scooter Software

                Comment


                • #9
                  Side note: all BC2.x minor updates are free for 2.x users. 2.5.2 is the newest BC2 version. You can get the update from our website here:
                  http://www.scootersoftware.com/download.php
                  Aaron P Scooter Software

                  Comment

                  Working...
                  X