5 Replies Latest reply on Aug 26, 2014 4:14 PM by philmodjunk

    Insert Picture script step fails with no error?



      Insert Picture script step fails with no error?


           I have a file that scans an image to the Temporary folder and then inserts the image into a container.  I then rename the image file (using a plugin) keeping it in the same place.  I move to another record and attempt to insert into another container.  Nothing happens.

           - I have the temporary folder open and can see it being created and renamed.

           - The plugin also lets you confirm the file exists and it returns no error when the path is checked.

           - I can see the file path in the script debugger and the path is correct for the first insertion and correct for the second insertion.

           - The Insert Picture script step returns no error but no file is inserted after the first insertion. The field is selected each time.

           - Works fine on OSX. Works fine for the first insertion.  I can stop the script after five failed insertions and then manually insert the file from the Temporary folder.

           Completely stumped..........



        • 1. Re: Insert Picture script step fails with no error?

               "scanning an image into the temporary folder" means what exactly? Do you rely on a plug in to do that?

               Have you tried testing parts of this script without using that plug in to see if the plug in is contributing to the issue? (You can rename a file without using a plug in by exporting the file from the container field, specifying the new file name and then re-inserting the newly exported copy...)

               Note that all script steps that start with Insert will silently fail to work if the field is not present and accessible on the current layout. That doesn't seem to be the issue here, but I'm mentioning it just in case it might be a factor here.


                    The Insert Picture script step returns no error

               Are you checking for the error code returned by this step? either via script debugger in FileMaker Advanced or with Get ( LastError ) immediately after the Insert step?

          • 2. Re: Insert Picture script step fails with no error?

                 The file is created by a plugin and then properly imports to a selected container with the script step.  The plugin then renames the file (I can see the file being renamed and updated). A new container is selected and then an attempt to insert the renamed file is made.  Same steps of selecting the container, confirming the file exists and then inserting the file in the selected container.  No insertion and no error created.  Pausing the script just before the second insertion attempt, I check the properties of the file and they are all correct.  I continue and Filemaker pretends everthing is OK but no file is inserted and no error generated even though I just manually confirmed the file. 

                 A few days ago I had to resort to exporting the container with a new file name and then reimporting.  I am getting the final results I wanted but I am still bothered by Filemakers failure to import and more disturbing its failure to report an error on the PC.  On the Mac everything works as it should with the first approach.

            • 3. Re: Insert Picture script step fails with no error?

                   Are you using a $Path variable? Are you sure that the file path is valid for a windows machine at the time that it is used? (Apologies if this is an obvious thing that you have already ruled out, but a file path that is valid on a Mac will likely be invalid on a Windows system due to the fact that file paths start with a volume name on Macs and a drive letter on Windows.

                   Other than that, you may want to report this as a possible bug over in Report an Issue. I suggest posting the actual script if you decide to post that issue report.

                   To post a script to the forum:

              1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
              3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
              5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
              7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
              • 4. Re: Insert Picture script step fails with no error?

                     Yes I am sure of the path. With a large monitor I can have the Temp folder Filemaker opens at start open, the Filemaker Advanced script debug window and the data tracking window open at the same time.  Slow step through shows everything is fine. The file is visible in the temp folder, the $Path is correct in the data tracking window and corrected using a replace script step to modify the path to get correct \ and / etc. from the Get(TemporaryPath).  It is the same path for the second file with the exception of the different file name as the first that inserts correctly.

                     If I go to a separate small script in a different file it finds the file and inserts in a test container.  No length of time pausing the script lets FM find and insert the file.

                     I spoke with the vendor for the plugin renaming the file and I agree with their response that if the file is there, can be opened in an image editor, has proper rights that he suspects Filemaker.

                     I suspect Filemaker also but past history of fining a bug report with a plugin involved results in less than a stellar response if you get one at all.  For now I will keep the export with new name, import work around.




                • 5. Re: Insert Picture script step fails with no error?

                       Please repost this as a bug report. I don't think your past response was typical. I'd post it for you, but I can't provide the needed details to document this.