No announcement yet.

Using Filters in Scripting

  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Filters in Scripting

    Hi All,
    Still evaluating BC and am working on attempting to develop scripts which can "call/load/refer" a particular or customized filter that was created in interactive mode. Can a session be saved as a .txt file which can then be manipulated/edited, batched? Similar in fashion to creating an interactive macro....saving time in batch creation?
    Also, is it possible to export the saved filter so it can be used or even just called in a script?
    Have only just begun my "eval", am liking what I see so far, and look forward to gaining some familiarity with the product and its nuances via experimentation. Thank you in Advance group, Cheers!

  • #2

    Filters can be loaded in script in two ways.

    The easiest method would be to save a Folder Compare Session, which can have any combination of session settings, filters, and loaded folders. This could have everything, then you would load "session name". Or, you can have just the filtering or session settings, but blank folders, then:
    load "Session name"
    load "c:\folder1" "c:\folder2"

    As script is a series of sequential commands, this loads your session settings/filters, then loads the two folders into this session, as if you took these two steps in the graphical interface. Sessions and other settings are saved per Windows User account, so your script will need to run as the same Windows User to have access to the saved sessions, or use a Portable Install/Single Directory Install to share settings among any user that runs it.

    Alternatively, scripting can pass in command line parameters, like:
    bcompare.exe "@C:\bcscript.txt" "c:\folder1" "c:\folder2" "-.\*.txt"

    where bcscript.txt then references these with %1, %2, etc:
    filter "%3"
    load "%1" "%2"
    folder-report layout:side-by-side output-to:"c:\bcreport.txt"

    The filter string is identical to the one used in the graphical interface toolbar, but with quotes added around it in script. This way, you can set one up in the interface first to preview it, then copy/paste into a script file.
    Aaron P Scooter Software