Get ( TemporaryPath ) returns the path to the client's temporary items folder and is adjusted for the platform they are using.
You can actually use this expression for both platforms:
Set Variable [$Path ; Value: "File:" & Get ( TemporaryPath ) & c_Customer BillId & ".pdf" ]
(Then use $Path in your file reference dialogs to save the PDF and also to attach it to an email if you need to do that.)
Thanks Phil. But even when I set temporary variable like you suggest and I only use temp variable I get this error ........pdf could not be created on this disk ..... is it possible that something is preventing FM to write to the temporarry folder on the client computer? (And the oddest thing is this worked yesterday just fine.)
And how come, as I mentioned before, I get different calculation result (same computer, same calcuation) depeneding on where the file is saved?
This is not making any sense to me right now.
This should work. It's what I use here. The error message from filemaker when this fails is very generic and doesn't help much in narrowing down the possible causes. You'll need to check the details of your script and calculated expressions very carefully to see what isn't correct. You can post your script here if you want.
You get different results because your calculation checks for whether this is a mac or windows platform and uses a different expression for each.
The expression I suggested eliminates the need for this additional complexity as it works equally well for both platforms.
To post a script to the forum:
- You can upload a screen shot of your script by clicking the edit link to your original message and uploading it there
- You can upload a screen shot to a file share site and post the download link to a new response you post here.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
- If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional look to your script. (Use the HTML option and paste the text into the HTML editor.)
Thanks Phil. I posted the screenshot of the script in the original message. I hope you can see what Is wrong with it.
I don't see any obvious errors in the script. The first thing that I'd check would be to make sure that bills::C_Customer Bill ID is returning a value that can work as a valid file name. (can't be empty, can't contain characters such as / that aren't permitted in file names...)