4 Replies Latest reply on Jan 14, 2013 4:42 PM by wimdecorte

    Send Event Calculation

    stratlake

      I'm trying to move a file from one windows directory to another using "Send Event". I would ordinarily use a batch file, however the path to the original file that I want to copy is a field.

       

      Currently I'm trying to use:

      Set Variable $Path {"cmd /c copy "&Frame Types Doc Store 2 SInvoices::Path&" J:PDFPDFtk inJobsheet2.pdf"} *Where ::Path is full path name.

      Send Event {$path}

       

      But having no success.

       

      Can anyone help me?

        • 1. Re: Send Event Calculation
          LyndsayHowarth

          I would think you need to be looking at the "Export Field Contents" script step if the field is a container field and you need to look at "Export" to export the contents of a field containing character data.

           

          - Lyndsay

          • 2. Re: Send Event Calculation
            wimdecorte

            No need to export anything or for a batch file.  What you're missing is quotes around the path if it contains spaces.

             

            Can you post back with an example of what is in the $path variable when you execute this?

            • 3. Re: Send Event Calculation
              stratlake

              The $path variable is cmd /c copy J:/Frame Types/Gilmore (Facade 1)_Timber Frame (VP).pdf J:\PDF\PDFtk\bin\Jobsheet2.pdf

               

              Quotes around the path (assuming you are talking about Frame Types Doc Store 2 SInvoices::Path) will return cmd /c copy Frame Types Doc Store 2 SInvoices::Path J:\PDF\PDFtk\bin\Jobsheet2.pdf

              • 4. Re: Send Event Calculation
                wimdecorte

                stratlake wrote:

                 

                The $path variable is cmd /c copy J:/Frame Types/Gilmore (Facade 1)_Timber Frame (VP).pdf J:\PDF\PDFtk\bin\Jobsheet2.pdf

                 

                Quotes around the path (assuming you are talking about Frame Types Doc Store 2 SInvoices::Path) will return cmd /c copy Frame Types Doc Store 2 SInvoices::Path J:\PDF\PDFtk\bin\Jobsheet2.pdf

                 

                cmd /c copy "J:\Frame Types\Gilmore (Facade 1)_Timber Frame (VP).pdf" "J:\PDF\PDFtk\bin\Jobsheet2.pdf"

                 

                 

                Should work. I've added quotes and used back-slashes instead of forward slashes in the source part.  Note that I've quotes around both path/filename combos.  It's a good idea to do even if a path or file name does not currently contains spaces, it makes your code future proof.