Announcement

Collapse
No announcement yet.

Suppress QuickCompare dialog from vbScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Suppress QuickCompare dialog from vbScript

    Following is a simple vbScript to test a call to BC3.

    Code:
     Option Explicit
    
     Dim WSHShell, BC3, LeftSide, RightSide, Result
     Set WSHShell = CreateObject("WScript.Shell")
    
     BC3 = """C:\Program Files\Beyond Compare 3\BComp.exe"""
     LeftSide = " ""D:\Test\Left.sql"""
     RightSide = " ""D:\Test\Right.sql"""
    
     Result = WSHShell.Run(BC3 + " /silent" + LeftSide + RightSide, 0, True)
     MsgBox Result
    If the files are different, BC3 opens. This is what I want to happen.
    If the files are the same, the QuickCompare dialog opens.

    I added the /silent parameter in an attempt to suppress this Quick Compare dialog. In other words, I don't want to see the dialog when the files are the same...I want BC3 to simply skip the compare and exit. I only want a BC3 to open a compare session when the files are different.

    I realize that I can make two calls to BC3... A quickcompare call to set the return code followed up by a regular call to open a session based on the quickcompare exit code... but why call BC3 twice for a simple same/different check? It would be helpful if there were an /ignoresame parameter that would abort the GUI programmatically when the files are the same and only open a session when the files are different (or if the existing /silent parameter could be expanded to serve this purpose).
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

  • #2
    Under the Tools menu -> Options, Startup, you can configure BC3 to start automatically in the Quick Compare dialog, then set that to Open the view automatically if files are different.

    The reason we show the Quick Compare dialog is the same way most zip applications pop-up a notification if the Test returns that the files are not corrupt: to show the user that it is ok. Otherwise it would be difficult for the user to see the difference between a successful call returning equal, a call where BC3 silently crashes partway through the compare, or the system preventing BC3 from launching at all.

    If you wish to create a custom solution around this: You could use the bcompare /qc command line instead to return the error codes, and from there determine what steps you would like to take.
    Aaron P Scooter Software

    Comment


    • #3
      I already have BC3 set to open automatically when the files are different.
      I am requesting the ability to skip the GUI automatically when they are the same...and only when called from the command line.
      BC v4.0.7 build 19761
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      Comment


      • #4
        Hello Michael,

        Could you go into more detail on how and where this would be used? Perhaps I am not understanding the request.
        Aaron P Scooter Software

        Comment


        • #5
          What is unclear from my first post? Currently I have to call BC3 twice to open only different files programatically. First call to get a return code. Second call to launch the GUI if the return code indicates that the files are different.

          I would appreciate a parameter that would allow me to use a single call to BC3 to open files that are different, but not files that are the same. In other words, where BC3 currently prompts me with a Quick Compare dialog stating that the files are the same, I simply want to suppress that dialog without opening the compare session in the GUI. I suggested that an /ignoresame parameter might be the logical implementation for such an enhancement.
          BC v4.0.7 build 19761
          ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

          Comment


          • #6
            Thanks for the suggestion, Michael.

            However, if we handle this internally without both calls to BC3, it could be hard to determine if BC3 was successful or if it crashed silently (unlikely, but possible). By calling it twice and checking for a specific return code, you can determine if the compare was successful silently and then call the GUI accordingly.

            How do you use BC3 where you do not want feedback if it was successful? Is this part of a larger automated solution?
            I'm looking for a concrete example of how you would plan to use this feature would help both you and other users to better flesh out details in a wishlist entry or to discuss with the developers.
            Last edited by Aaron; 05-Oct-2009, 04:47 PM. Reason: additional workflow
            Aaron P Scooter Software

            Comment


            • #7
              I would use it when programatically comparing two folders for which I want all differences to open in the GUI. Two calls is less efficient than one. Besides, suppressing a Quick Compare dialog when files are equal doesn't mean that BC3 can't return a return code. Setting the ErrorLevel on exit would be feedback enough to eliminate the possibility that BC3 crashed silently.
              Last edited by Michael Bulgrien; 06-Oct-2009, 09:17 PM.
              BC v4.0.7 build 19761
              ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

              Comment


              • #8
                Hello Michael,

                Would another acceptable workflow be for you to do this by launching a Folder Compare, using the Display Filters to show only different items, double click the first item, and then use the hotkeys to jump between differences and Next Different File?

                If this needs to be launched from an application, that application could call a Portable Install of BC3 with specific saved defaults and load the two folders.
                Aaron P Scooter Software

                Comment


                • #9
                  No. I use vbScripts for scenarios that typically are not easily managed in the GUI (compares after programmatic edits or involving advanced file alignments). I also prefer to have multiple sessions opened simultaneously (rather than utilizing the "Next Different File" option) so that I can visually compare differences between different file pairs.

                  Since I obviously can call BC3 twice (and have done it this way in the past) this is not a high-priority request... it just seems like a waste of cpu cycles when a single call would be sufficient for a user who just wants the default compare criteria applied to a command line call to BC3 and the compare session opened in the GUI only when differences are present.
                  BC v4.0.7 build 19761
                  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎