How exactly does this fail on the machines where it doesn't work?
What you describe would only work if all users have "write" permission to that temp folder and the filepath to that folder is mapped/mounted to be the same for all users--something not always possible if some machines are macs and others windows.
But there's no need to use that temporary folder. Your script can use the temporary folder on each client machine and insert the PDF into the container from there instead of the temp folder on the server.
As I have begun to dig into the issue, I found that the user can see the contents of the Temp folder, but doesn't have write access to it. I tried to create a txt file inside that directory from an errant machine, and it failed the Windows Permissions test.
Our network admin says that this user, and others apparently, have been given the same permissions to that folder that my machine has, but for whatever reason, from the perspective of the client machine, the write access is denied.
This has me wanting a different way altogether of creating these pdf records, since it is unpredictable what will happen trying to do it on a shared network folder.
So, to your suggestion Phil, is it a certainty that every machine is going to have Temp folder defined the same way, or is there a way to have the script "find" the Temp folder first, before it is used. It could be that some of our users have monkeyed with the location of the Temp folder. Not saying that it HAS happened, but I wouldn't be surprised.
Due to differences in OS and user accounts, it will be different every time, but if you use the Get ( TemporaryPath ) function, you can get the file path to it for the local machine without having to explicitly state it.
So, I used the Get (TemporaryPath) function, and it failed. I think I have a problem with the Domain Account privileges in Win7. I also found and tried Get(DesktopPath) and encountered the same. My machine was recently wiped clean and re-installed, so I think there may be a problem that began there.
Side-note/question: is there a way to delete the file in the temp path at the end of the script so that nothing remains except the record in the container field? I've searched the built-in functions, and the custom-function site, but haven't found anything that looks like it will work. I just need a "clean-up" routine at the end of the script.
I suggest that you spell out the details of how it failed unless the following links solve the issue(s) for you. Perhaps it was not implemented correctly. It would seem to me very unlikely that Get ( TemporaryPath ) or Get ( DesktopPath) would fail on any machine where you have FileMaker Installed unless something pretty major was wrong with your OS install or OS based user account settings.
See this thread for an example script using Get ( DesktopPath ). You could substitute Get ( TemporaryPath ) in the example script and get the same results only the PDF gets saved to the Temp folder instead of the desktop. (I'd use Get ( DesktopPath) during initial tests and then switch to the temporary folder once I see that the PDF is being successfully created on the DeskTop.)
And if you want to learn more about $Path variables, Container fields, file paths and the script steps that can use them, see: Exploring the use of a $Path Variable in Scripts for an "exploration file" that illustrates a number of key details and which can be used to determine actual file paths to specific locations on your computer.
Thanks Phil. On top of everything else, I was having internet issues as well, so posting a screenshot of the error message was not happening. I'll read thru the links, and see if I can work through it. The gist of the script does some of what is suggested there ( I scanned thru the links to get an idea of what others are doing). I really believe it has more to do with the re-install of my OS at this point and the way the User Accounts were set up.
But do you know of a function that will allow me to do a file-delete from the temp location after the pdf is inserted into a container field? I was looking at the Script steps that are sorted under "Files" but I figured those were more "filemaker files" related than OS files (.pdf, .txt, etc).