6 Replies Latest reply on Feb 15, 2013 9:16 PM by BenO

    Rename a document placed in a container?

    BenO

      Title

      Rename a document placed in a container?

      Post

           Is it possible to drag a document into a container and rename it as it is stored in a specified directory?

        • 1. Re: Rename a document placed in a container?
          philmodjunk

               A script can use export field contents to export the field to a specified location and rename the file as part of that action. (use a variable for this)

               It can then re-insert the file from that new location to update the container field to either store or reference the file by its new name.

          • 2. Re: Rename a document placed in a container?
            BenO

                 Ok, I have the script set up to export field contents and a variable set up to rename it. what is the syntax to use when using the variable in the filepath? when i run the script, it uses the variable name as the new file name.

                 haven't tried the re-insert portion yet. is that the "insert file" feature?

            • 3. Re: Rename a document placed in a container?
              philmodjunk

                   You'd use it like this:

                   Set Variable [$Path ; Value: "file:" & Get ( TemporaryPath ) & "NewFilename.Extension" ]
                   Export Field Contents [YourTable::YourContainerField ; $Path ]

                   Just type in the exact name of your variable into the Specify Output File dialog and do not use quotes.

              • 4. Re: Rename a document placed in a container?
                philmodjunk

                     There are several "insert" steps that insert into a container field. You should select the script step that is consistent with how the file was originally inserted unless you also want to have a change in how you can interact with the file.

                • 5. Re: Rename a document placed in a container?
                  BenO

                       I have the Set Variable and Export Field Content working. Also had the Insert File feature working, except that it must not be the same as how I originally inserted the file. I expect that I'll be inserting the file by dragging and dropping in most cases.

                       When I use the Insert File, it doesn't allow me to interact with the PDF (I do have the container set up to be interactive).

                       Which script step for inserting the renamed file is consistent with drag and drop insertions?

                  • 6. Re: Rename a document placed in a container?
                    BenO

                         Figured it out...just changed the dialog options in the script step options. Thanks so much for your help.