10 Replies Latest reply on Oct 5, 2015 6:37 AM by Kaps_1

    insert file

    Kaps_1

      Hello,

       

      I am trying to insert a pdf file (created by Filemaker) into a fied. I am using the Insert Field step, but nothing is being put into the field. The file is currently being stored on the desktop and if i insert it manually, it does appear. Can anybody spot what I am doing wrong ? The script is below:-

       

      email quote.jpg

      Thank you in advance,

       

      Kind Regards

      Kaps

        • 1. Re: insert file
          Markus Schneider

          check the path, ie by debugger or by showing a custom dialog with $filename. I'm on iPad can't test - but isn't it a slash instead of an backslash - and the filename shoukdn't need the slash anyway

           

          btw. the script saves to the temp folder, not desktop

          • 2. Re: insert file
            Mike_Mitchell

            You never set $temp_folder. You need to add a Set Variable script step to do this. Something like this:

             

                 Set Variable [ $temp_folder ; Get ( TemporaryPath ) ]

            • 3. Re: insert file
              erolst

              Try removing the Enter Preview Mode[] step.

              • 4. Re: insert file
                Markus Schneider

                same for $job_id..

                 

                I would start over with that script, from scratch

                - define variables

                - get desired records (find, etc)

                - set correct state (browse)...

                - export to $filepath (with filename)

                -> then check for that file

                • 5. Re: insert file
                  clind

                  Also remember, if you are inserting a pdf, you need to start the file path with "imagewin:". It won't work if you leave this out.

                  • 6. Re: insert file
                    Kaps_1

                    Thanks - I should have pointed out that I only posted the relevant part of the script - not the whole lot. It has been working succesfully for a couple of months until I had to make a change.

                     

                    kind regards

                    Kaps

                    • 7. Re: insert file
                      Kaps_1

                      Thanks - can you explain how to add imagewin to the filepath ? And what if you have a Mac ? (The client has a network of both Macs and windows).

                      • 8. Re: insert file
                        Kaps_1

                        erolst - Thanks for your suggestion to get rid of Enter Preview mode. I have put it back in Browse mode as per the script below (which also shows that all variables have been defined) - but I still don't get the file beingemail quote NEW.jpg stored. Any suggestions ?

                        • 9. Re: insert file
                          erolst

                          Kaps_1 wrote:

                          erolst - Thanks for your suggestion to get rid of Enter Preview mode. I have put it back in Browse mode as per the script below

                           

                          Well, when I said “get rid of it” I meant it; just like Print[], Save Records as PDF[] doesn't require you to switch to Preview mode; these operations will automatically create their output based on it. So you can optimize your script by avoiding the potentially expensive switching back and fro between P and B mode.

                           

                          (By the same (or a similar) token, you don't need to Show All Records before performing a Find.)

                           

                          Now, is the field into which you want to insert actually on the layout?

                          • 10. Re: insert file
                            Kaps_1

                            Thank you erolst - putting the field on the layout solved the trick. Much appreciated.