TroiToFMP ( TroiPath, FileOrImage )
Converts TROI File Plug-in paths to FMP Paths
Average rating: 4.4 (32 votes) Log in to vote
DW Data Concepts
TroiToFMP("C:\Documents and Settings\TestImage.jpg", "Image")
imagewin:/C:/Documents and Settings/TestImage.jpg
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Converts TROI File Plug-in paths to FMP Paths. If this path is a FILE or FOLDER, use "file" as the FileOrImage value. If this path is an IMAGE, use "image" as the FileOrImage value.
Takes into consideration MAC and WINDOWS platforms.
Gregg Holbert, Fort Worth, Texas
Jan 17, 2017
/*Did not work for UNC filepaths on Windows for me. I added the last Substitute to fix it.*/
x = TroiPath;
p=Abs(Get(SystemPlatform)) = 1;
mr=If(a = "File"; "filemac:/"; "imagemac:/") & Substitute(x; ":"; "/");
wr=If(a = "File"; "filewin:/"; "imagewin:/") & Substitute(x; "\\"; "/")
If( p ; mr; (Substitute(wr; "filewin:///"; "filewin://") ) )
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.