Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Path.FileMakerPathToNativePath
Converts a FileMaker path useful for "filemac:" and "filewin:" path specification to a native path.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Path | 2.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
path | The FileMaker file path. | "/Macintosh HD/Users/test/Desktop/picture.jpg" | |
PassThroughNativePath | Available in MBS FileMaker Plugin 11.0 or newer. Whether to pass through a native path directly and avoid conversion, if the path is valid already. Default is 1 to enable this. |
1 | Optional |
Result
Returns the native path.
Description
Converts a FileMaker path useful for "filemac:" and "filewin:" path specification to a native path.The difference between a native path and a FileMaker path on Mac is, that FileMaker expects to have the Disk Name in front followed by the rest of the path. macOS functions require paths from the root disk to start without volume name. Other disks have paths starting with "/Volumes/name".
This function does not work for relative paths.
For version 11.0 we build in a check to pass through valid native paths. You should not need this feature as you care about your paths and you know what path you put into what variable, right?
Examples
Convert path to native path:
MBS( "Path.FilemakerPathToNativePath"; "/Macintosh HD/Users/test/Desktop/picture.jpg")
Convert path with path list:
MBS( "Path.FileMakerPathToNativePath";
"file:test/picture.jpg¶" &
"fileLinux:/test/picture.jpg¶" &
"fileMac:/Macintosh HD/Users/test/Desktop/picture.jpg¶" &
"fileWin:D:\test\picture.jpg" )
// pick the right path from a list of paths.
Batch convert list of paths:
# test kopie20 in file Contacts
Set Variable [ $FMPaths ; Value: "/Mac/Users/test/Desktop/picture1.jpg" & ¶ &
"/Mac/Users/test/Desktop/picture2.jpg" & ¶ &
"/Mac/Users/test/Desktop/picture3.jpg" & ¶ &
"/Mac/Users/test/Desktop/picture4.jpg" & ¶ &
"/Mac/Users/test/Desktop/picture5.jpg" & ¶ &
"/Mac/Users/test/Desktop/picture6.jpg"]
Set Variable [ $NativePaths ; Value: While (
[ list = ""; i = 1; c = ValueCount ( $FMPaths ) ] ;
i ≤ c ;
[ path = GetValue($FMPaths; i); npath = MBS( "Path.FileMakerPathToNativePath"; path ); list = list & npath & ¶; i = i + 1 ] ; list ) ]
Show Custom Dialog [ "Native Paths" ; $NativePaths ]
Mix use of native and FileMaker style paths:
Set Variable [ $tempFM ; Value: Get(TemporaryPath) & "test.txt" ]
# convert to MBS
Set Variable [ $tempMBS ; Value: MBS( "Path.FileMakerPathToNativePath"; $tempFM) ]
# write file with MBS
Set Variable [ $r ; Value: MBS( "Text.WriteTextFile"; "Hello World"; $tempMBS; "UTF-8") ]
# now have FileMaker email it with the FileMaker style path
Send Mail [ Send via SMTP Server ; No dialog ; “$tempFM” ]
See also
- WindowsUserNotification.SetImagePath
- WordFile.OpenFile
- X509.ReadFromFile
- XL.Book.AddPictureFile
- XL.Book.SaveToFile
- XL.Initialize
- XML.ValidateFile
- ZipFile.CRCFile
- ZipFile.Open
- ZipFile.WriteFile
Release notes
- Version 12.0
- Fixed Path.FileMakerPathToNativePath to recognise filelinux: prefix.
- Version 11.0
- Added PassThroughNativePath flag to Path.FileMakerPathToNativePath function to disable the pass through of valid paths.
- Version 8.0
- Fixed an issue where Path.FileMakerPathToNativePath would not convert a path on Windows.
- Version 7.5
- Changed Path.FileMakerPathToNativePath to detect if passed path is already a native path and return it.
- Rewrote Path.FileMakerPathToNativePath to work with path list.
Example Databases
- AVRecorder/AV Recorder Record Dictation
- Containers/Create Container Preview
- DynaPDF/Form/Form
- DynaPDF/ZUGFeRD
- Files/FileMakerPath to NativePath
- Network/ServerSocket/ServerSocket from Webviewer/ServerSocket from Webviewer
- WebViewer/Calendar/Calendar
- WebViewer/MethodDraw SVG Editor/MethodDraw
Blog Entries
- Use web viewer in FileMaker to show 3D models
- MBS Plugin Advent calendar: 7 - Paths
- GraphicsMagick in FileMaker, part 1
- MBS FileMaker Plugin 12.5 News
- New in MBS FileMaker Plugin 12.1
- Save PDF to container in FileMaker
- Using TLS when connecting to MySQL server
- PDF Forms with MBS Plugin
- Restart FileMaker with same database
- MBS Filemaker Plugin 2.7 Release notes
FileMaker Magazin
This function is free to use.
Created 18th August 2014, last changed 20th February 2024