Newbies Yuval Posted April 5, 2016 Newbies Posted April 5, 2016 I am trying to use ScriptMaster GetFileAsContainer to populate a container field with a file in the temporary path. My script is basically: set variable ($pathToFile = "file:" & get(temporarypath) & "test.xlsx") export records ($pathToFile) set field (myContainer = GetFileAsContainer( $pathToFile )) The file is created, I can see it, the container field exists and is in the current context, The ScriptMaster module is registered, but I am getting an ERROR in the container. Any help? Thanks
john renfrew Posted April 5, 2016 Posted April 5, 2016 you need to use an OS path in the second part of the script not a FileMaker one...
rwoods Posted April 5, 2016 Posted April 5, 2016 As John said, just change set variable ($pathToFile = "file:" & get(temporarypath) & "test.xlsx") to set variable ($pathToFile = Get(TemporaryPath) & "test.xlsx") and it should work. Interesting that FileMaker creates the file successfully but won't retrieve it, even with the same path though...
Newbies Yuval Posted April 5, 2016 Author Newbies Posted April 5, 2016 John and rwoods, Thank you for your responses, but this had been tried with the same result. My path is /Macintosh HD/var/folders/90/_04p5y4n2fvc5gpr5_9bl5600000gp/T/S10.1/test1.xlsx when I manually try just: /var/folders/90/_04p5y4n2fvc5gpr5_9bl5600000gp/T/S10.1/test1.xlsx it works. So the "/Macintosh HD" is not liked. Is there a problem with spaces in the path? advice appreciated. Thanks
Newbies Yuval Posted April 5, 2016 Author Newbies Posted April 5, 2016 ... I tried the same thing on a server with path /sofia/..... Again, with the full path the code fails. However when I strip the /sofia (the computer name) from the path it is successful. I tested the same thing with the Base Elements plug-in and had the same results We are using OSX El Capitan. Has anyone else experienced similar issues? Is this a known issue with Path names in this OS? Thanks
clemhoff Posted April 7, 2016 Posted April 7, 2016 Hello, On 05/04/2016 at 2:49 PM, Yuval said: My path is /Macintosh HD/var/folders/90/_04p5y4n2fvc5gpr5_9bl5600000gp/T/S10.1/test1.xlsx Your path is kind of "Finder path"… To write the absolute/canonical path the "Unix way", just prepend the disk name by "/Volumes". /Volumes/Macintosh HD/private/var/folders/90/…etc…/file.xlsx /Volumes/Macintosh HD/Users/userAccountName/Desktop/ /Volumes/myExternalDrive/aFolder/aSubfolder/afile PS: no problem with spaces in a path, Scriptmaster's function arguments are all strings and are internally quoted at compile time.
Newbies Yuval Posted April 7, 2016 Author Newbies Posted April 7, 2016 Thank you clemhoff. Indeed /Volumes in front of the path does the trick.
Recommended Posts
This topic is 3220 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now