run command to "sync" files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fpdave
    Journeyman
    • Apr 2008
    • 17

    run command to "sync" files

    I actually want to use a folder compare, and then to "copy" over the differences by running a command line utility.

    I want to do this to compress pictuers (jpegs) as they are copied accross to my mobile device (which doesnt do this on sync - Android tablet)

    so, each file which doesnt exist on the RHS (on the mobile device) should be run against this cmd line utility, which will compress the jpeg and output to the RHS.

    Obviously my folder comparison will ignore file size (just using file name and date).

    can scripting do this?

    or should I just write nmy own program?

    I certainly dont want to compress all files as I have 8GB of pics!
  • Aaron
    Team Scooter
    • Oct 2007
    • 16026

    #2
    Hello,

    Beyond Compare has the ability to define an "Open With", which can launch a command line on a specific selection within Beyond Compare. You can create one in the Tools menu -> Options, Open With section.

    Also, which kind of compression are you using? You can always use Beyond Compare 3's Copy To Folder dialog and append a .zip to the destination folder. This will make it a zip file instead of a folder.
    Aaron P Scooter Software

    Comment

    • fpdave
      Journeyman
      • Apr 2008
      • 17

      #3
      the "compression" is actually resizing of an image down to 1024x768 or something similar.

      If I could script the compare, and also script the
      select all differences, then
      run "open with..." on all selected files

      then this might do the trick

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16026

        #4
        We do not have Script to call an Open With. You would only need script if you are looking for an automated solution.

        You can use the Display filters to show only different files, and the Expand All and Select All Files commands to select all your different files previous to running the Open With.

        Alternatively, you can use script to generate a text report of all the different files, and use another program to parse the report for a list of files and act on them exterior to BC3.

        How does that work for you?
        Aaron P Scooter Software

        Comment

        • fpdave
          Journeyman
          • Apr 2008
          • 17

          #5
          I really am looking for a fully automated solution, something I can run and leave to sync up my tablet with pics from my pc

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16026

            #6
            For the fully automated solution, you can run a BC Script from the command line using:
            bcompare.exe @"c:\script.txt"

            Where script.txt will contain a series of bcscripting commands. We do not have an open with command, but we can load pairs of folders, expand all, and generate a report showing only the different files in a parse-able format, such as XML. This XML file can then be used by you to parse, select the files in another application, and perform whichever compression you would like.

            Scripting documentation is found in the Help file under Scripting Reference, and under the Using Beyond Compare -> Automating with Script section. Your script will probably look something similar to:

            load "c:\folder1" "c:\folder2"
            expand all
            folder-report layout:xml options:display-mismatches output-to:"c:\folderreport.xml"

            Let us know if you have any questions.
            Aaron P Scooter Software

            Comment

            Working...