Once you are in a remote desktop environment, imagewin:C:/ParkingLot/filename.pdf.
is meaningless to that remote desktop session. Local drives like your C drive can be made available to the remote session but they show up as network shares so the syntax is different. AND it is not a given that local drives are made available, a lot of organizations do not allow that.
So first figure out if local drives can be "forwarded" to the remote session. If they can then each RDP session config needs to be set up the same so that all clients will have the same experience (a deployment issue).
Then in your scripting you need to do the insert from the network share syntax. If the solution is also used outside of an RDP session then you need a way of figuring out what the session is. Typically you can do that by checking the client's IP address, the RDP session will have a known static IP address (or if the TS/Citrix environment is load-balanced, a range of known static IP addresses)
Thanks Wim. That is what I have asked them to verify. The solution requires that only one specific user uses the file insert script.
The thing that puzzled me is why this script would work on a local file on the VM session but not work once the file is moved to FileMaker server and accessed from the same VM session.
Another option is to use the users desktop path in the remote session. It is alwasy going to be the same relative path for every user. Plus there will never be any "rights" issues. Some environments are tied down pretty tight, so a file from the "System" drive cannot be accessed.
In Windows, you can just copy & paste the file from your local file location to the desktop in the remote session or from a Mac, you can setup the remote options so that your local drives are mapped to the RDP session.
User the command "Get ( DesktopPath )" in your file location calculation.