June 6, 200718 yr 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?
June 6, 200718 yr 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
June 6, 200718 yr Author 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.
June 6, 200718 yr "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.
June 6, 200718 yr 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.
June 6, 200718 yr ... 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.
Create an account or sign in to comment