Tapatalk

Calling UltraCompare from a script in UltraEdit

Calling UltraCompare from a script in UltraEdit

2
NewbieNewbie
2

    17:26 - 16 days ago#1

    Can you call UltraCompare from a script in UltraEdit?  I want to have a script that will pull a source code file from our test directory and compare it to the file that is in the production directory.  I currently manually open each files and then click on UltraCompare.  Currently, I have the script prompting the user for the base filename but now I need to call UltraCompare.

    Any help would be greatly appreciated.

    6,685587
    Grand MasterGrand Master
    6,685587

      18:25 - 16 days ago#2

      That is possible with UltraCompare Professional which can be executed also from a script like a batch file or a PowerShell script or an UltraEdit script if there is a user tool configured which runs uc.com or uc.exe in program files folder of UltraCompare with the appropriate options to do the file comparison and either display the results or write them into a text file.

      It is not possible with UltraCompare Lite installed with UltraEdit because of ucl.exe in subdirectory uclite in the program files folder of UltraEdit can be executed only from the Compare Files/Folders dialog window of UltraEdit. There is no script/macro command to run the Compare command of UltraEdit as it is the case for all UltraEdit commands opening a dialog window on which the user must manually take actions before it can be executed finally.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        21:24 - 16 days ago#3

        I was trying to do this in the tool configuration.

        Command line: C:\Program Files\IDM Computer Solutions\UltraCompare\uc.exe -t %1 %2

        Then I was trying to call it with:

        Code: Select all

        UltraEdit.runTool("runUC", fullFileNameTest, fullFileNameProd);
        But that did not work?

        6,685587
        Grand MasterGrand Master
        6,685587

          6:28 - 16 days ago#4

          The command line is of wrong syntax.
          1. The fully qualified file name of uc.exe contains space characters and must be therefore enclosed in double quotes:
            "C:\Program Files\IDM Computer Solutions\UltraCompare\uc.exe"
          2. %1 and %2 are placeholders for the first and the second file name of the two text files to compare. There must be real file names specified on the command line. One file name could be the file name of the active file referenced with "%f". The other file name must be specified in the command line of the user tool configuration and is therefore fixed.
            If both should be variable, %1 %2 must be replaced by %sel% and the script writes into the active file or a new file the two file names with full path enclosed both in " with a space between the two file names and selects them before running the user tool. The two file names must be deleted from active file or the new file is closed without saving it after the user tool execution for running UltraCompare finished.
          I recommend reading the help page Configure tools command (Advanced tab/User tools dropdown) in help of UltraCompare (first choice) or the UltraEdit wiki page Configure tools (second choice). It is not possible to specify two file names on clicking on the symbol or menu item for running a configured user tool. It is therefore also not possible to call the scripting command UltraEdit.runTool with more than one string. This scripting command must be always executed with just one string which defines the name of the configured user tool.

          See also the forum topic: How to run ANY console or Windows application from within an UE script/macro?
          Best regards from an UC/UE/UES for Windows user from Austria