Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6989 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I developed a report-generating script which Exports a foundset to TempFile.fp5, Saves-As-Clone a template file SalesRpt.fp5, and finally passes control to a script in the clone, which Imports the TempFile. (The user then can play with SalesRpt.fp5, sorting and printing as he likes.)

It all worked fine when I developed and ran it under FMP6.0.4 client. I'm having trouble when I deliver it to the customer to run on his server, and I'm unclear on what happens where in a server environment. In particular, I don't know how to control *where* the tempfile and cloned file get created.

The database lives on the server and is served by FMS5.5. Ideally, however, I'd like both the TempFile.fp5 and the cloned SalesRpt.fp5 to be created on the client's machine.

(Currently, the script fails with "Cannot create TempFile.fp5 - either disk is full, or disk is locked, etc." I assume it is trying to create the file somewhere on the server machine.)

Both the Export and the SaveAs script steps include a "Specify File" option. Do I have to require the customer to manually specify those each time he runs a report, specifying a location on his own particular computer? Or is the way to have it automatically create those files somewhere on the current user's computer?

Hope I've covered all the particulars here....

Thanks tremendously,

Chap

Posted

You should let the user determine the destination for the file, or possibly you need to re-edit the script on the users machine.

When you developed the db the file/folder structure on your machine is (almost certainly) different to the user, so FMP is trying to locate the original filespec.

It won't be saving the file to the server as the filespec can't possibly be looking there (you developed without the server !)

Posted

You should let the user determine the destination for the file, or possibly you need to re-edit the script on the users machine.

Thanks, Mark,

I now understand why I was getting the error.

I'd prefer not to have to require the user to deal with Specify File dialog boxes. I assume that your second suggestion involves running the script once with Specify File turned on, to teach the script the desired destination, and then to edit the script to turn off Specify File.

Won't that permanently tie the script's file specs to that user's machine, making it impossible for more than one client to use the script? Or does FM Server magically know to place the files on the current user's machine?

Would it be better to simply create those files on the server (taking care that two people aren't running the script at the same time) and then use some other automation to transfer the file to the right user?

Chap

Posted

There has been a fair amount of discussion about this problem. But it is spread around in different forums, much of it in the AppleScript forum.

Script steps that deal with locations are resolved on the client machine. This is opposite to the way that FileMaker relationships are resolved, which are resolved internally on the server machine. These steps must resolve on the client machine. File sharing is OFF on the server machine. The client cannot access files on that machine, other than via FileMaker sharing, which is a totally different technology.

So when you "export" or "import", or any such steps, you're using the file paths of the client machine. When you're developing on your stand-alone machine, you may do exports to the same folder as the local FileMaker files, or to your desktop, etc.. These "relative" paths do NOT exist for hosted files. You need absolute paths, with full file paths of the correct syntax for the operating system AND available on every client machine.

On Mac OS X such a path would usually be: "filemac:/Macintosh HD/Users/Shared/ExportFile.extension"

You will not see this path on FileMaker 6 (you can in 7). But if you set up an export to the above folder locally it will still work when the FileMaker file is hosted (except for smart alecks that rename their hard drive).

You can then move the file to a more convenient location, using AppleScript or Troi File, etc.. Such as their desktop; which AppleScript, Troi File, and FileMaker 8 can find, but which Filemaker pre-8 can't, because of the user name in the file path.

Posted

Okay, this is how I understand it, after the above discussion:

There is one, and only one, location specification that is saved with a script step. The location specification is in the form of a full/absolute path, starting with the name of the hard disk. At the script's run time, the path is evaluated relative to the client machine (not the server).

Machines with custom HD names, or paths that lead into a user's home directory, won't work. It is impossible to configure a script step on a server to (for example) automatically Export data to "the user's desktop", because the location [filespec?] is literal and would have to include the user's HD name and user name.

My best bet, then, is to do as Fenton suggested and save to Macintosh HD:Users:Shared:xxx.xxx and require that nobody rename his HD.

Is this an accurate restatement of the facts?

Thanks!

Chap

Posted

That is pretty much accurate. It is possible to store more than 1 export path in the export file reference, separated by returns. But you can't see this in FileMaker 6, and it makes little practical difference, as you can fork the script depending on platform anyway.

Also, the path from FileMaker is how I wrote it, not separated by colons (yours is a Mac path, like AppleScript would use). Not that it matters if you're on FileMaker 6, 'cause you can't see it anyway. You pretty much have to create the export from a client machine in 6, in order to get the right path. In 7 you can just type the path ahead of time.

This is all pretty easily doable with FileMaker 8, by using the Get(DesktopPath) function to set a Script Variable. So if you can upgrade do so.

Aren't we all glad that Steve Jobs and Bill Gates created personal computers, separately ;)-|

Posted

Thanks for bearing with me -- I get it now.

I'm also hoping this is the last time I have to do anything significant in 6; jumping, as I am, straight into 8 is pretty pleasant ;)-)

Posted

Well, dang.

I spoke to the client today, and everyone renames his HD.

Other than asking that everyone rename back to Macintosh HD, is there anything that I can do to have a server-resident script export to the client machine? I believe Fenton answered this earlier (basically, no) but I want to be sure.

Thank you,

Chap

Posted

When you get to FileMaker Pro 8 take a close look at using variables in conjunction with the DesktopPath function to name files and place them on the Dekstop or in the user's documents folder when doing an export.

HTH

Steven

This topic is 6989 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.