Jump to content
Server Maintenance This Week. ×

ScriptMaster GetFileAsContainer


This topic is 2949 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • Newbies

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

Link to comment
Share on other sites

  • Newbies

... 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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 2949 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.