you may not be able to do this quite the same on both os's but that is easy enough to work around...
you need a script assigned to the button and look something like this
If [ Abs(Get(SystemPlatform))=1 ] #Perform AppleScript ["<applescript text>"] Else Send Event [ open document/application; example::path ] [ Bring application to foreground ] End If
Thank you for the suggestion wich may be helpfull in quite a few situations, just that learning apple script and event script is just a bit too much for the purpose (and my patience!)
I actually found an interseting way to do it:
I created a mutlimedia field which serve just as a button, and I assigned an OnObjectEntry script to it. Let say that the file to be openend is :
and that directory YYY is mapped as "S" in windows, the script builds the following string (2 lines !) and assigne it to the multimedia field
Then double clicking the multimedia file opens it.
This way you could even open a different file version depending on any criteria such as user right...
I think the easiest way is to create a FileMaker calculation field with a Container result, using your original file path.* Then use the standard script step, Go To Field [ Select/Perform ].
The path needs to be a FileMaker syntax path, but this is not that hard to calculate. It will have a different prefix, "filemac:" or "filewin:", depending on platform. But you can easily figure that out using Abs (Get (SystemPlatform), which produces 1 for Mac, 2 for Windows.
The other part which is different between the platforms is the name of the server. It is easy enough to see what that is by using Insert file on a Mac, then on a Windows machine. The resulting server name and syntax would then be included in the calculation, either hard-coded, or via a text field from a single-record Constants table.
If you create a script to do this, then the field on the layout can be non-enterable. You can either show it on the layout, as the file name & icon, or just make it tiny, like 1 pixel, and hide it.
Go to Field [ z_cFile_FM; Select/Perform ]
Commit Record [ no dialog ]
* Your original file path is what syntax? FileMaker? Mac? Windows? In any case you're going to need to dynamically convert it for the current user's platform, no matter what method you use to open it. Unless it can be served via a web server, in which case you could use a Web Viewer and OpenURL.