Saving External Conversion File

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    Saving External Conversion File

    When I try to save the converted file (which was converted from binary) I only get two temp files and can't get the original filename which I need to be able to convert the process back.
    Is there another variables to get the original filename like you have which source %s and target %t?

    - Ying
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    Re: Saving External Conversion File

    This depends on the converter. Some of our conversion rules don't support saving back to the binary format.

    Correction - Conversion Doesn't Work This Way
    If you're using a converter that does support saving back to a binary format, %s is the original file name and %t is the name of the temp file.

    In the conversion tab of Tools|Edit Current Rules, you can add your converter in the "Run When Saving" prompt. Something of the form: "texttobinaryconvert.exe %t %s" should work if you have a proper converter.


    Correct Way Conversion Works
    %s is always the source file, %t is always the file to be written.
    So to convert, the correct command line is something like "texttobinaryconvert.exe %s %t".

    It turns out it isn't possible to save back to the original file name, it is only possible to do a "Save As" with converted binary files.
    Chris K Scooter Software

    Comment

    • Guest's Avatar

      #3
      Re: Saving External Conversion File

      > Correct Way Conversion Works
      > %s is always the source file, %t is always the file to be written.
      > So to convert, the correct command line is something like "texttobinaryconvert.exe %s %t".

      When I pass these arguments to the bat file i get refernce to two temporary files, e.g. %s= C:\DOCUME~1\a58697\LOCALS~1\Temp\BC291.tmp %t= C:\DOCUME~1\a58697\LOCALS~1\Temp\BC292.tmp, and not to the original filename from %s as I expected. I need the original filename to be able to translate the text back to a binary file. I don't need to save back to the original filename, but I need the filename to be able to convert the file back properly.

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Re: Saving External Conversion File

        The variables %s and %t are always temp files when writing the file out.

        Once the conversion is done, bc copies the %t temp file to the file name that you're saving as.

        Does this method not work with your converter? If so we can add an original file name variable to a future version of BC.
        Chris K Scooter Software

        Comment

        • Guest's Avatar

          #5
          Re: Saving External Conversion File

          No, our converter doesn't support only the temp names. It needs the original filename as well.

          I would like the feature yuo suggested for the new bc.

          Comment

          • Chris
            Team Scooter
            • Oct 2007
            • 5538

            #6
            Re: Saving External Conversion File

            Thank you for the clarification. I'll add an original file name variable to our feature wish list.
            Chris K Scooter Software

            Comment

            • Zoë
              Team Scooter
              • Oct 2007
              • 2666

              #7
              Re: Saving External Conversion File

              It turns out this is already in the official release and we just forgot to document it. In addition to the %S and %T variables, you can also use %N to get the original filename (without path), and %X to get just the original extension (with a period).
              Zoë P Scooter Software

              Comment

              • Guest's Avatar

                #8
                Re: Saving External Conversion File

                I try to use it (%n %x), but it turns out to be empty.

                Comment

                • Chris
                  Team Scooter
                  • Oct 2007
                  • 5538

                  #9
                  Re: Saving External Conversion File

                  Are you using the latest version of BC (2.3.1). Are there spaces in the paths of the files being compared?
                  Chris K Scooter Software

                  Comment

                  • j_dawg99
                    Visitor
                    • Feb 2009
                    • 5

                    #10
                    Old thread, but I am having exactly the same problem (need original file name, %n %x are empty, etc.). I can't find the solution in the forums.

                    To answer your questions, I am using 2.3.1. There are no spaces in the original path, but there are spaces in the temp path that BC uses as a working directory.

                    Comment

                    • Michael Bulgrien
                      Carpal Tunnel
                      • Oct 2007
                      • 1772

                      #11
                      Originally posted by j_dawg99
                      Old thread...
                      To answer your questions, I am using 2.3.1...
                      Very old thread. Latest BC2 build is version 2.5.3
                      BC v4.0.7 build 19761
                      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                      Comment

                      • Aaron
                        Team Scooter
                        • Oct 2007
                        • 16026

                        #12
                        Hello,

                        Please upgrade to the latest version of BC2 if you can, and email us the specific information you are entering to [email protected]
                        Aaron P Scooter Software

                        Comment

                        • j_dawg99
                          Visitor
                          • Feb 2009
                          • 5

                          #13
                          %n and %x work correctly with latest version.

                          I would still need the path of the original file as well, but from what I've read in the forums I don't think that is available, correct?

                          Comment

                          • Aaron
                            Team Scooter
                            • Oct 2007
                            • 16026

                            #14
                            Hello,

                            Sorry, there is not a way to access the original file path using the %variables. This layer is in place to protect the original file from potential modification from an external conversion process.
                            Aaron P Scooter Software

                            Comment

                            Working...