12 Replies Latest reply on Aug 8, 2015 9:20 PM by philmodjunk

    Export Paths

    MarkBanin

      Title

      Export Paths

      Post

      Hi

      Using FM14 on Win 8.1

      I have container fields where each one contains a picture.  I'm trying to set up a local path that when I hit the export button it stores the Picture (using its original filename) in the directory without dialog.

      Now it works OK If I use the dialog, It just means that the first time I export I have to specify the destination folder and then of course press Save to close the dialog each time.

      This is the path I'm trying to use: C:\Users\Mark\Desktop\___ Temp Store

      I've tried this: "file:/C:/Users/Mark/Desktop/___ Temp Store" which creates a document called "___ Temp Store" in the folder path: "C:\Users\Mark\Documents"

      Any suggestions would be greatly appreciated.

      Mark

        • 1. Re: Export Paths
          philmodjunk

          You should be able to set a variable to the Filepath and file name and then use that variable with Export Field Contents to export a copy of that file to the specified directory.

          There's not enough detail in your post to be able to tell why this did not work for you.

          Perhaps you could use Post A New Answer to post a comment that shows how you are trying to use a file path with Export Field Contents so that we can see where/why it isn't working for you?

          • 2. Re: Export Paths
            MarkBanin

            Hi

            Thanks for your reply.  I tried assigning the path to a variable but got identical results.

            Below is a screen shot showing all the info...

            The Result is I get a file called "___Temp Store" placed in Directory: C:\Users\Mark\Documents

            Thanks

            Mark

            • 3. Re: Export Paths
              philmodjunk

              And that's exactly what you should get. You haven't specified a file name as the last part of the path.

              You should be using something like:

              "file:/C:/Users/Mark/Desktop/___ Temp Store/FILENAMEGOESHere.Extension

              This assumes that you have a folder on your desktop named ____ Temp Store.

              Here's how I would do it:

              Set Variable [$Path ; Get ( DesktopPath ) & "___ Temp Store/" & GetContainerAttribute ( YourTable::Container ; "FileName" ) ]

              • 4. Re: Export Paths
                MarkBanin

                Ahhhh GetContainerAttribute.....I really should have thought of that!

                Thanks very much for that.

                Mark

                • 5. Re: Export Paths
                  MarkBanin

                  I think I may have found a bug....

                  So, I've tried it the way you suggested

                  The Variable $ExportPath holds the correct path but for some reason, instead of going to the desktop its going to the Documents folder (see below)

                  I created a Dialog box to see if the path was registering correctly....and it was

                  I checked the location of the desktop (see pic) and that's ok

                  And the pic on the right shows the actual location it ended up!

                  What do you think?

                   

                  • 6. Re: Export Paths
                    philmodjunk

                    I doubt that you have a bug except in your script. This is a pretty commonly used method and we'd have a lot of reports over in Report an issue.

                    I suggest posting the current version of your script.

                    • 7. Re: Export Paths
                      MarkBanin

                      Here's the script (below)....and as I showed in the previous screenshot the variable is set correctly as is shown by the custom dialog box.

                      I can't see how it can be anything but a bug...

                      • 8. Re: Export Paths
                        philmodjunk

                        I'd like to see the entire script, not just the set variable step in it.

                        • 9. Re: Export Paths
                          MarkBanin

                          HI, I'm not sure what else you mean?  The only other thing is the Export Field contents which you can see in the screenshot.

                           

                          Mark

                          • 10. Re: Export Paths
                            philmodjunk

                            I'd like to see the complete script in the scripts workspace and not just the one step. If that's a script of two steps, I want to see those two steps. By uploading a new screen shot of the two steps listed together you confirm that there have been no unintentional changes to your script.

                            • 11. Re: Export Paths
                              MarkBanin

                              I feel like a fool.....

                              The Path had a space in the middle: "Temp Store".  The folder did not.

                              What a dumbass - 

                              Sorry for wasting your time.  But thank you for the script above.  I now know how to make paths dynamic.

                              • 12. Re: Export Paths
                                philmodjunk

                                And apologies for my last post. I wasn't seeing that complete script, just the set variable, but when I scroll back, now I see it.

                                You've experienced what I have posted several times in this forum: File paths must be exactly right. One little detail wrong and they don't work.