14 Replies Latest reply on Mar 14, 2017 6:05 AM by blaise

    Export Records script step is returning error message

    blaise

      Using FM 12 Pro. When my script gets to "Export Records [No dialog; "For Database Import-Isolates.txt"; Macintosh]" script step I get the following error box (attached document.) It says: "For Database Import-Isolates.txt" could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk

       

      I have tried multiple times: changing the file name; moved the file to a different disk; and unlocked the whole disk and volumes/folders in the path. There is about a terabyte of space on the disk. I have tried putting the file in the FM 12 folder in the Applications folder and elsewhere in other folders.

       

      Of course, after each change of name or location, I re-designated the file in the script step by drop-an-drag to avoid typing error of the path.

       

      Any suggestions, please. I am at the end of my rope. Thanks.

       

      --Blaise

        • 1. Re: Export Records script step is returning error message
          philmodjunk

          If you select Export Records from the File Menu, can you export records via that method?

           

          A manual export performs many of the same tasks as your script, so being able to export manually (or not) may provide a clue as to why you are having trouble.

           

          Sharing a copy of your script--you can post a screen shot of it, might also be helpful.

          • 2. Re: Export Records script step is returning error message
            blaise

            Hi, thanks,

             

            Yes, the manual export works fine.

            Here is the script. I hope it comes through. All I get from dragging and dropping the TIFF file is a spinning sunflower.

            • 3. Re: Export Records script step is returning error message
              philmodjunk

              Yes your screen shot was uploaded, though in my experience .png files work better for uploading screen shots here.

               

              If you have FileMaker Advanced, I suggest running this script with the debugger enabled so that you can step through it step by step and see where any errors might be occurring.

               

              Also, when you manually exported, to where did you export? I don't see any info in the script that would specify a specific directory to which to export these records. It's possible that you are selecting a location where your computer account grants "write" permission for creating the exported text file, but that your export records script step is trying to "write" to a folder where you do not have permission to create such a folder.

              • 4. Re: Export Records script step is returning error message
                blaise

                I don't have FM Advanced. The script works fine up to the two Export Records step.

                 

                When I successfully exported manually, I exported to the exact folder that the script step is directed to (see attached).

                 

                I have set the read and write permissions to the whole disk and folders in the path.

                 

                Output File Path.png

                • 5. Re: Export Records script step is returning error message
                  philmodjunk

                  If you don't have advanced, how do you know that it:

                   

                  works fine up to the two Export Records step.

                   

                  ??

                   

                  Next thing that I'd check is to confirm that the scripted find is actually finding records.

                  Then confirm that the layout's table occurrence is correct for both the find and the export. (A table occurrence is a "box" in the relationships graph. This is selected in Show Records from in Layout setup and also in the source table drop down in your export records dialog.

                  • 6. Re: Export Records script step is returning error message
                    blaise

                    I know that is works up to that point because all it does is ask me for what to search for, then, upon entering that and doing the find, I can see in the layout window that it does the find correctly. The next two steps are the two Export Records steps, both of which produce an error message.

                     

                    This script worked fine for years when I had the FileMaker program, the database file, and the export files all residing on our Time Capsule so that different people on other computers could access the database (but not at the same time). But when it came to be that I was the only one using the database, I transferred everything to my computer. It works much faster on my computer then when it was on Time Capsule. After having done this, the only thing I have found that doesn't work the same is this Export Records step. It's very simple, should work, but it doesn't.

                     

                    I checked the things you said and everything is correct. The table that it is finding records in and exporting is not related to any other table in the database. The script should export the found records to the text files, then, later in the script, import those records into the main database.

                     

                    Thanks for your help.

                    • 7. Re: Export Records script step is returning error message
                      philmodjunk

                      I suggest that you try

                       

                      a) Recovering the file

                       

                      b) If recover doesn't fix the issue, create a completely new script for exporting records (you can keep the script very simple for testing and then expand it if it works for yo.

                       

                      I suggest this because your use of TimeCapsule for this could have damaged your file and this damage may only have affected the behavior of your file just recently.

                      • 8. Re: Export Records script step is returning error message
                        keywords

                        The only time I've ever run into that error message is when OSX permissions are not properly set up. For exporting via a script you need to make sure fmserver and fmsadmin and fmuser (something like that anyhow) have read & write access to the folder you are using. Sometimes these permissions can get corrupted if you copy and paste folders; if that is the case you can get round it by creating new folders and transferring the contents rather than the folders themselves. You should be able to test this possibility by changing your export filepath to use Get ( TemporaryPath ) which will use a location FM itself creates on the fly. If that still fails, then something else is causing your problem.

                        • 9. Re: Export Records script step is returning error message
                          user19752

                          You are missing volumeName in the path.

                          • 10. Re: Export Records script step is returning error message
                            Vaughan

                            To export to the documents folder you should be using get( documentspath ) function.

                             

                            Script this by setting a variable (say $path) to the document folder and the file name, the specify the variable ibt the export step dialog.

                             

                            Set Variable [ $path ; Get( DocumentsPath ) & "whatever.pdf"

                             

                            Note these is no need to prepend "file:" to the path (in later versions, not sure about 12 -- you should upgrade).

                             

                            As others have said, OSX limits where applications can save files.

                            • 11. Re: Export Records script step is returning error message
                              blaise

                              OK, I recovered the file. Nothing found wrong in the report. Script still did not work.

                               

                              Did as you said, made a new script with just the Export Records step. After selecting the records manually, the new script worked.

                               

                              Went back to the original script and took out the Export Records steps and saved. Then I replaced them, saved and they worked. Then later in the script the Import Records steps gave me error messages, but for them all I had to do is go in and re-designate the target files. It all works.

                               

                              Thank you for being so patient and for your excellent suggestions.

                              • 12. Re: Export Records script step is returning error message
                                blaise

                                I had changed permissions to Read and Write for everything in the path.

                                 

                                The issue has been resolved by deleting the erring steps, saving, then adding them back in "fresh".

                                 

                                Thanks for your help.

                                • 13. Re: Export Records script step is returning error message
                                  blaise

                                  No, doesn't need that (at least in this version). Besides that path was put there by the selection of the file through the "Add File..." dialog box.

                                   

                                  Thanks for your help.

                                  • 14. Re: Export Records script step is returning error message
                                    blaise

                                    Thanks for your suggestions. I am not sure FM 12 uses variables in scripting. When I wrote these scripts I could have used them and searched in the help docs but found nothing on them, so I assumed they couldn't be used and scripted around the need for them. Anyway, your suggestions are food for thought and I will consider them.

                                     

                                    If FM 12 does allow variables in scripts, please correct me.

                                     

                                    My scripts are now working. I deleted the erring steps, saved, then added them back in.

                                     

                                    Thanks again.