"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?
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.
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:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- 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.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- 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.
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.
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.