Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

FM - Problems Exporting

Posted on 2011-09-30
10
535 Views
Last Modified: 2012-05-12
When I try to run a scheduled scriopt to export a .tab file, I get error 800 that it cannot save file to disk.  Yet, when I run it manually, I have no problem.  Any suggestions.  See screen prints. export1 export2
0
Comment
Question by:rvfowler2
  • 5
  • 4
10 Comments
 
LVL 25

Expert Comment

by:Will Loving
ID: 36893416
When doing an export with a script, the "Cannot save file to disk" error message is almost always caused by the export path being incorrect. I develop cross-platform so I use Set Variable [ $FilePath ] to create a path that works with either platform. For example:

Set Variable [
   $FilePath ;
   Value: Case( Abs( Get ( SystemPlatform ) ) = 1 ; "filemac:" ; "filewin:" ) & Get ( DesktopPath ) & "vacancy.tab" )
]

Create a $FilePath variable like this or using your own path other than the Desktop and then set the Export Path to $FilePath instead of the hard-coded "vacancy.tab"
0
 
LVL 25

Expert Comment

by:Will Loving
ID: 36893486
Special Additional Tip for Mac Users who want to export to Excel when using Mac OS 10.7 (Lion).

Mac OS 10.7 (Lion) no longer supports the "Excel 95-2004 Workbook (.xls)" format because 10.7 no longer includes "Rosetta" support. It will only export to the newer "Excel Workbook (.xlsx)" format.  If you have a script that exports to this format that might someday run under Mac OS 10.7 or higher you will need to modify your scripts. Here's one approach:

Change the $FilePath calculation noted above to detect 10.7 or higher. A File path to save a "Profits Report" to the desktop might look like this:

Case( Abs( Get ( SystemPlatform ) ) = 1 ; "filemac:" ; "filewin:" ) & Get ( DesktopPath ) & "Profits Report"
&  Case( Abs( Get ( SystemPlatform ) ) = 1 and  Get ( SystemVersion ) = 10.7 ; ".xlsx" ; ".xls" )

Then, take your Export Records script step, duplicate it and change the export format to "Excel Workbook (.xlsx)" and add the following If Statement:

If [ Abs( Get ( SystemPlatform ) ) = 1 and  Get ( SystemVersion ) = 10.7 ]
  #Use newer .xlsx format for Mac OS 10.7 or higher
   Export Records [ No dialog; "$FilePath" ; Unicode (UTF-16) ] ]
Else
  #Use older .xls format for all other situations
   Export Records [ No dialog; "$FilePath" ; Unicode (UTF-16) ] ]
End If

0
 
LVL 2

Author Comment

by:rvfowler2
ID: 36893815
Not sure how assiging it a variable will help.  Decided to put the export in its simplest form.  The below ran fine when run manually and saved vacancy.tab to my C drive; however, when scheduled off the server, it did not save it and gave me an 800 error again.  Seems something is wrong with FM export when scheduled in the Windows environment.

filewin:/c:/vacancy.tab
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 25

Expert Comment

by:Will Loving
ID: 36893936
Ah, you neglected to mention that this was being run as a server-side scheduled script which may very well make a difference. The 800 error is generated because: "You can get this error when you export field contents, and the app does not have write permissions to that directory."

Based on that I would check to make sure that FileMaker Server would be allowed to save to the c: drive on the server. If you stop FMS and open the files in FMPro on the server, does the script work properly? With FMS running can you open the files using Open Remote, trigger the script and have it run correctly?

You are correct that the script variable is not necessary, I just find it helpful since paths, for example to the desktop, are calculated while yours does not need to be.
0
 
LVL 10

Accepted Solution

by:
webwyzsystems earned 250 total points
ID: 36907165
This might be helpful: a reference to filemakers support on this topic.

http://www.filemaker.com/11help/html/scripts_ref1.36.69.html


0
 
LVL 2

Author Comment

by:rvfowler2
ID: 36911112
OK, so after reading web's help link (see relevant info below), am I correct in understanding that -- just like importing -- you can only export a file to the temporary or Documents folder?  What a limitation!!  I can work around this by doing a SendEvent a copying the file to the location I want, but it seems a ridiculous limitation.

Notes
 •  When using the Export Records script step or Import Records script step in a FileMaker Server scheduled script, keep the following in mind:

 •  Any specified file must be in the FileMaker Server Documents folder, the temporary folder, or a child folder of either the FileMaker Server Documents folder or the temporary folder. For example, the following are all valid paths for file.csv:

<Documents>/file.csv
<Temporary Path>/file.csv
<Documents>/Folder1/file.csv
<Temporary Path>/Folder1/Folder2/Folder3/Folder4/file.csv
 •  Any path specified that isn’t a complete path to the file (for example, anything other than
/Library/FileMaker Server/Data/Documents/<0 or more directories>/<filename> ) is evaluated as being relative to the temporary path.

 •  Any paths that include “..” are considered invalid.

 •  For FileMaker Pro, if an absolute path is not specified in a script that will be executed from FileMaker Pro, the path is assumed to be relative to the location of the database file from which the script was run. For example, if a script containing the Export Records script step is run with the pathname file:/export.tab, and the file running the script is /MyFiles/Library/Books.fp7, the exported file will be created as /MyFiles/Library/export.tab.

 •  If you are using a calculation that generates the file path for the XML file, you need to use the format used by the operating system for the the full path. For example, the following are valid paths if you are using calculations to generate the path for the XML file for Windows or Mac OS:

Mac OS: /Volumes/VolumeName/directoryName
0
 
LVL 25

Assisted Solution

by:Will Loving
Will Loving earned 250 total points
ID: 36911305
The limitation applies only to Scheduled Server side scripts. I'm not sure why the limitation exists but I'm guessing there is a good reason, possibly related to server permissions which can be much more elaborate and finicky than on a regular workstation. Keep in mind that server-side scripts are an extension/add-on to FM Server's core functionality. FM Server is completely different from FMP where one has almost complete flexibility about where to save things to with an export.

So yes you will need to either do something to copy the file elsewhere or have whatever is picking it up know where to look in the allowable folders.
0
 
LVL 2

Author Closing Comment

by:rvfowler2
ID: 36911571
Webz, thanks for the pointer toward the Help file; thought I had already checked that.  Will, thanks for the clarification as the Help isn't written as clearly.  I'll need to be careful about assuming server scheduled scripts can work the same as ones run from FMP, even if I do account for server compatible script steps and for the different location of the server.
0
 
LVL 2

Author Comment

by:rvfowler2
ID: 36911585
Note:  The limitation to importing and exporting only from the Documents folder is a real hindrance as I much prefer to do both processes once per day outside of normal business hours.  I can see why one could not save to just anywhere on the server, but not why one could not use scheduled scripts to save to another file server.
0
 
LVL 25

Expert Comment

by:Will Loving
ID: 36911617
One thing you might try is creating a shortcut within one of the allowed folders to the actual location you want to save to. See if the scheduled script will permit you to save to the shortcut path and have the shortcut re-route the actual file to where you actually want it to go.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filemaker Pro and FM Go Synch 1 247
Updating a Date difference Calculation field 4 160
Airport Extreme 802.11ac 15 85
Problem to file 4 28
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question