Re: Default file locations/behaviour
- From: d-42 <db.porsche@xxxxxxxxx>
- Date: Thu, 18 Oct 2007 13:40:45 -0700
On Oct 18, 11:49 am, David Lesher <wb8...@xxxxxxxxx> wrote:
I'm back with all new dumb questions.
The FMP programer [who speaks M$ about as well as I do; ie we run in
fear..] needs to script writing the XML files to local storage.
<http://www.filemaker.com/help/ScriptsRef-267.html>
THEN, a fileviewer will point to the web site's maint page & prompt
for upload.
The hassle is: WHERE on the local box? Per the above FMP defaults
to the APPLICATION's subdirectory; grr..
In OSX, it can be written as /tmp/sample.xml or ~/sample.xml.
But in M$? A guru who works in Redmond tells me:
No, there's no environment variable, built in junction, or built-in
cmd shortcut to it (not that any but the junction would help you)
<http://www.microsoft.com/resources/documentation/windows/xp/all/prodd...>
...
%USERPROFILE% is the current user's profile folder. The current user's
document folder is one folder underneath that [1], either "My Documents"
or just "Documents" [2] depending on the system.
He added:
I don't speak FMP, but it looks like there's some sort of variable
support, and a function called "Get(DocumentsPath)" that seems like
it'll give you a FMP friendly path to the My Documents folder that you
should be able to feed to the path you store the target file in.
Now; the XML need not go on th desktop, and there is
TMP=C:\DOCUME~1\[blah-user]\LOCALS~1\Temp
that might work.
But I'm not conversant in either M$ internals or FMP's to know what best/works at all.
tmp would be ideal except for one gotcha; when you spawn a webviewer, and it pops
up a CHOOSE-A-FILE box; what directory does IT start in? In OSX, at least, it does
not allow easy [if at all..] Finder browsing to /tmp.
Typically, they open in the last place they were pointed at, and
usually default to the users desktop or documents folder.
1) How do you write FMP scripts that specify a known-writeable/findable destination
independent of client type/configuration?
The temporary folders in windows are not generally great places to
have user interact with.
I'd recommend for the windows users to just write to a specific folder
off the root c: drive. It will be easy to navigate to in the file
browser. (Just create a dedicated folder for that purpose... e.g. c:
\filemaker export\; this would have to be done in advance of using the
script.)
You culd define the variable you use for the file path to be dependant
on the platform version.
set variable $myfilepath =
if ( get(platform)=Mac (i think its 0 for mac 1 for windows);
"filemac:\somewhereonthemac";
"filewin:\c:\filemaker export\")
Actually I *think* you don't even need a variable or "if", if you just
define a filewin:\ and a filemac:\ llocation in the export dialog box
filemaker automatically will use the appropriate one... but I havent'
tested this yet on exports. Also If you define multiple filewin:\
entries filemaker apparently is supposed to use the first valid one it
can find... but again I haven't tested this on exports (just imports).
2) And... Will a new write automatically overwrite the existing file of that name,
or should we erase it first?
It will overwrite the existing file.
-dave
.
- Follow-Ups:
- Re: Default file locations/behaviour
- From: David Lesher
- Re: Default file locations/behaviour
- References:
- running shell scripts from Filemaker Pro
- From: David Lesher
- Re: running shell scripts from Filemaker Pro
- From: Erik Wessel-Berg
- Re: running shell scripts from Filemaker Pro
- From: David Lesher
- Re: running shell scripts from Filemaker Pro SERVER
- From: David Lesher
- Re: running shell scripts from Filemaker Pro SERVER
- From: Howard Schlossberg
- Re: running shell scripts from Filemaker Pro SERVER
- From: d-42
- Re: running shell scripts from Filemaker Pro SERVER
- From: David Lesher
- Re: running shell scripts from Filemaker Pro SERVER
- From: d-42
- Re: running shell scripts from Filemaker Pro SERVER
- From: David Lesher
- Re: running shell scripts from Filemaker Pro SERVER
- From: d-42
- Re: running shell scripts from Filemaker Pro SERVER
- From: David Lesher
- Re: running shell scripts from Filemaker Pro SERVER
- From: Howard Schlossberg
- Re: running shell scripts from Filemaker Pro SERVER
- From: d-42
- Re: running shell scripts from Filemaker Pro SERVER
- From: David Lesher
- Re: running shell scripts from Filemaker Pro SERVER
- From: d-42
- Re: running shell scripts from Filemaker Pro SERVER
- From: David Lesher
- Re: running shell scripts from Filemaker Pro SERVER
- From: d-42
- Re: running shell scripts from Filemaker Pro SERVER
- From: David Lesher
- Default file locations/behaviour
- From: David Lesher
- running shell scripts from Filemaker Pro
- Prev by Date: Default file locations/behaviour
- Next by Date: Re: Default file locations/behaviour
- Previous by thread: Default file locations/behaviour
- Next by thread: Re: Default file locations/behaviour
- Index(es):
Relevant Pages
|
Loading