wdedalus Posted June 6, 2007 Posted June 6, 2007 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?
Fenton Posted June 6, 2007 Posted June 6, 2007 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
wdedalus Posted June 6, 2007 Author Posted June 6, 2007 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.
comment Posted June 6, 2007 Posted June 6, 2007 "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.
Fenton Posted June 6, 2007 Posted June 6, 2007 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.
Genx Posted June 6, 2007 Posted June 6, 2007 ... 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.
Recommended Posts
This topic is 6773 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