ConvertFromFileMakerPath
Converts a path in FileMaker format to a standard format.
Format
ConvertFromFileMakerPath ( filemakerPath ; format )
Parameters
filemakerPath
- any text expression or text field containing a path in FileMaker format.
format
- a numeric value that specifies the standard format in which to return the path (see below).
Data type returned
text
Originated in version
19.0
Description
FileMaker clients and hosts internally use paths in the formats shown in Creating file paths to specify external files or FileMaker data sources. Before you can use these FileMaker paths to work with external systems, you need to convert a FileMaker path to a standard format that the external system supports.
Use the format
parameter to specify one of the following standard path formats.
|
For paths used by |
Standard format |
|
POSIX (Unix-like) operating systems—for example, macOS, iOS, iPadOS, and Linux |
/directory/filename |
|
Windows operating systems |
drive:\directory\filename, where drive is the drive letter |
|
Web-based systems—for example, REST APIs and the Insert from URL script step |
file:///directory/filename, if path is for a local file Claris Pro: claris://host.domain/directory/filename, if a Claris Network path, which starts with fmnet:/ FileMaker Pro: fmp://host.domain/directory/filename, if a FileMaker Network path, which starts with fmnet:/ |
-
You can specify
format
using either the named constant or the numeric value shown in parentheses—for example,WinPath
or 2—without quotes.
The FileMaker path of a hosted FileMaker Pro file can only be converted to a URL path that uses the fmp scheme. When a FileMaker path can’t be converted to the specified format, this function returns "?".
Notes
-
FileMaker paths that use path prefixes beginning with
file
,image
, ormovie
and ending withwin
,mac
, orlinux
are converted in the same way as thefile
prefix. See About path prefixes.
Example 1
For |
Returns for |
file:/Macintosh HD/etc/hosts Full path to a local file on the root volume of a POSIX system |
URLPath: file:///etc/hosts PosixPath: /etc/hosts WinPath: ? |
file:/Clients/contacts.txt Full path to a local file on a non-root volume of a POSIX system |
URLPath: file:///Volumes/Clients/contacts.txt PosixPath: /Volumes/Clients/contacts.txt WinPath: ? |
file:/C:/Users/John Smith/Documents/test.xlsx Full path to a local file in Windows |
URLPath: file:///C:/Users/John%20Smith/Documents/test.xlsx PosixPath: ? WinPath: C:\Users\John Smith\Documents\test.xlsx |
file://computerName/Documents/test.xlsx Full path to a file on a remote Windows computer |
URLPath: file://computerName/Documents/test.xlsx PosixPath: ? WinPath: \\computerName\Documents\test.xlsx |
fmnet:/fmhost.example.com/My Clients.claris fmnet:/fmhost.example.com/My Clients.fmp12 Full path to a hosted Claris Pro or FileMaker Pro file |
URLPath: claris://fmhost.example.com/My%20Clients.claris URLPath: fmp://fmhost.example.com/My%20Clients.fmp12 PosixPath: ? WinPath: ? |
file:dir1/dir2/file.fmp12 A path relative to the current FileMaker Pro file |
URLPath: ? PosixPath: dir1/dir2/file.fmp12 WinPath: dir1\dir2\file.fmp12 |
Example 2
ConvertFromFileMakerPath ( "file:Import/Sales.xlsx" ; PosixPath )
returns Import/Sales.xlsx.
Example 3
For a Table::Filename field that contains "contacts.txt," returns file:///Users/UserName/Documents/contacts.txt (the path of this file in the current user’s Documents folder in URL format).
ConvertFromFileMakerPath (
"file:" & Get ( DocumentsPath ) & Table::Filename ; 3
)