Re: Path to opened FM database
Re: Path to opened FM database
- Subject: Re: Path to opened FM database
- From: Gary Lists <email@hidden>
- Date: Thu, 10 Jul 2003 14:18:27 -0400
On or about 7/10/03 12:34 PM, Matyas Ferenc Farkas wrote:
>
Hi!
>
>
Is there a script, which returns the location path of an open database in
>
FileMaker?
>
>
For instance the "path to me" command, which returns the alias of the
>
script, if it was saved corectly.
>
>
Thanks!
>
--
>
Bye!
>
Matyas Ferenc Farkas
Matyas,
Szervusz! Hogy van?
The answer: Igen.
'the answer' ... ez mi Magyarul?
(Nem tudok Magyarul. ;)
So...
Yes. Within FM, you can use the Status(CurrentFilePath) to set a field.
Then, via AS, you can read the value of that field.
I do it this way:
[fm_script] Name: Set Path
Set Field "dbPath" to [Status(CurrentFilePath)]
-- field 'dbPath' is global text, not on any layout (but you can, I just
don't)
[applescript]
tell application "FileMaker Pro"
do script "Set Path"
set pathToOpenDB to cell "dbPath" of layout 0
end tell
-- operate with pathToOpenDB as needed
SOME HELPFUL INFO
from FM dictionary
do script : Execute a script
do script string -- The name or specifier of the FileMaker script to be
executed
Result : anything -- The result of the Script
from FM help menu
Status (CurrentFilePath)
Parameters: None
Data type returned
Dependent on data type of active field [**]
Description
Returns the the location of the file in a URL-like format; however, the
path is not URL encoded.
Example
Status (CurrentFilePath) returns file://path/databaseName for local files.
Status (CurrentFilePath) returns FMP5://netAddress/databaseName for remote
files.
Copyright (c) 1994 - 2002 FileMaker, Inc. All Rights Reserved.
[**] I don't specifically know what they mean by that. I treat it as text
and go about my business. No problems encountered. Active field should mean
the field in which the cursor is active, but I don't have to have any active
field to run a FM script that sets a global to the text path of the running
DB. Their help is sometimes a bit oddly worded, even for native English
speakers.
--
Gary
MacOS 9.1 / "9 is Fine"
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.