Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I host a FM database online that several people in my company access from different locations. I recently built a series of scripts that pull a list, sort it, and save it to my desktop.

When my co-workers try to run these scripts, they get an error message because FM is pointing the document to save on *my* desktop.

Is there some way to save to a relative filepath (like filemac:Desktop/filename.xls), so that no matter who runs the script, the file will be saved to the desktop of the computer they are using?

Posted

Use the Get ( DesktopPath ) function. Set a script Variable, $filepath

"filemac:" & Get ( DesktopPath ) & file name.ext

If some are on Windows, use a calc for the prefix;

Case ( Abs ( Get ( SystemPlatform )) = 1; "filemac:"; "filewin:" ) & Get ( DesktopPath ) & file name.ext

Posted

tried it, doesn't work. i also tried variations...

"filemac:/" & Get ( DesktopPath ) & "/CEC1.xls"

filemac:/ & Get (DesktopPath) & "/CEC1.xls"

filemac: & Get ( DesktopPath ) & /CEC1.xls

thanks for the help, by the way. mighty kind.

Posted

"doesn't work" is not a good description. What does your calculation return?

Try removing the slash before filename. Get ( DesktopPath ) already has a slash at the end, so that would be at least one problem.

Posted

Yes, that's what usually gets you, the fact that the Get (*path) functions already have the beginning and ending slashes.

It always helps to create a calculation field or use Data Viewer to look at file paths.

Posted

... you know whats better than this:

Case ( Abs ( Get ( SystemPlatform )) = 1; "filemac:"; "filewin:" ) & Get ( DesktopPath ) & file name.ext

??

"file:" & Get(DesktopPath) & "filename.ext"

Anyway, yeah I always have to construct my filepaths in the dataviewer cause frankly i forget what Get(DesktopPath) returns.

This topic is 6381 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.