Re: Default file locations/behaviour



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

.



Relevant Pages

  • Re: Protecting directories and files.
    ... Let the application access only C:\MyApp folder and subfolders ... Protect the content of the files from other users ... Problem 2 can be solved using Windows security by giving access to the files ... the XML files my application reads and writes are in clear text; ...
    (microsoft.public.dotnet.security)
  • Re: Automate a task for an FTP Site
    ... I have a folder on my computer with X amount of XML files ... I need to create one folder on the FTP site for each one of the XML ... the CLI I use provides transparent FTP support ...
    (microsoft.public.scripting.vbscript)
  • Re: running shell scripts from Filemaker Pro SERVER
    ... We have a FMP database updated by <10 people. ... So the FMP programmer has written a script to create the XML files on the ... We can use scp to push the files up. ... But the Windoze boxes can't accept a bash script. ...
    (comp.databases.filemaker)
  • Re: Does SP2 need them?
    ... Delete them to the Recycle Bin for a few days. ... .XML files 'can' be hard to ... > Please don't confuse this folder with the one where Temporary Internet ...
    (microsoft.public.windowsxp.general)
  • Re: 5 to 7 Conversion issues
    ... it is absolutely wrong and forbidden with FileMaker ... (either FMP or FMS) ... The only correct way to setup a network configuration that includes ... 'FileMaker' Server 7' folder or one level below - in a folder called for ...
    (comp.databases.filemaker)

Loading