We use the Open URL script step to open files, and our URL has to be calculated based on the captured filepath. Mac and Windows read filepaths differently.
Thanks very much for the answer, but it is discouraging to have to use such a difficult workaround.
How do you determine the captured filepath?
Oops. Probably nothing is captured because you are storing by reference,
in which case, you have a fixed filepath.
It just needs to be calculated as a URL.
Our URL is based on this (dynamic) path calc:
- "http://[IPaddress_here]/" & directory path(s) & "/"
Yours will need to have the appropriate path parts inserted.
Is this normal behavior? Is there a workaround?
Unfortunately this is normal behavior for the situation you describe.
As to a workaround, perhaps.
If the files that are added are always referenced files in a folder on the server as you describe, you may be able to create a more general file reference immediately after the user adds a file. If this is a scripted activity, add a line to the script. Otherwise use a script trigger.
Basically what you'll do is to append the Windows file reference to those containers edited my Mac clients and a Mac-specific file reference to those added by Windows clients.
You'll need to do a bit of homework to find out what you need to add.
Do a GetAsText(TheContainerField) on a container submitted by a Mac client and another by a Windows client to find out what the file reference looks like in each case. (filewin: for Windows and filemac: for Mac.)
Then SetField on the container to be a calculation that has both formats. You want to add either a filewin: or a filemac: line depending on which is missing.
This would be something like: (have not tested this)
currentContainerRef = GetAsText(MyContainer);
theFilename = some calc to extract the filename from currentContainerRef;
macRef = "filemac:/your mac path here/" & theFilename;
winRef = "filewin:/your windows path here/" & theFilename
PatternCount(currentContainerRef; "filewin:") > 0; currentContainerRef & "¶" & macRef;
PatternCount(currentContainerRef; "macwin:") > 0; currentContainerRef & "¶" & winRef;
Thanks. I think we may go with a relatively simple, if quite clunky, solution, which is to have two container fields, one for a PC and one for a Mac, and then double-place the file(s) using the respecitve platforms. It's unfortunate that what seems like a simple function should be so complicaed in FileMaker. Of course, placing the file itself in the container, rather than a link, would also be a solution, but may make the DB huge.