Brian Dunning's FileMaker Custom Functions

GetExtensionsPath

Calculates the path in which to put plug-ins

  Average rating: 4.1 (43 votes) Log in to vote

Jens Rasmussen   Jens Rasmussen
Fimano
http://fimano.dk/filemaker/toolbox.html

Share on Facebook Share on Twitter

  Sample input:
()
  Sample output:
/AM08/Users/JR/Library/Application Support/FileMaker/Extensions/

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

The Extensions folder next to the FileMaker app can be read-only if the user is not an admin on the actual machine. This path:
~/Library/Application Support/FileMaker/Extensions/
will take precedence over the aforementioned.

The word "Library" can be seen in local translations [Danish: Bibliotek].

Windows support now included, thanks to briandunning.com's bright users.

 

Comments

Max Heller   Max Heller, fmax software
Dec 18, 2009
On windows, Get ( PreferencesPath ) returns:

"/C:/Documents and Settings/USERNAME/Local Settings/Application Data/"

and the Extensions path is:

"C:\Documents and Settings\USERNAME\Local Settings\Application Data\FileMaker\Extensions"
 
Max Heller   Max Heller, fmax software
Dec 18, 2009
Here is a cross platform version:

Let(
[
prefPath = Get( PreferencesPath );
macExtensionPath =
Substitute(
prefPath;
"/Preferences/";
"/Application Support/FileMaker/Extensions/"
);
winExtensionPath = prefPath & "FileMaker/Extensions/";
path =
If(
Abs( Get( SystemPlatform ) ) = 1;
macExtensionPath;
winExtensionPath
)
];
path
)
 
Bob Stuart   Bob Stuart, Noosa, Queensland
Dec 20, 2009
I tried Max's code, as written, in a CF and got warning dialogs galore objecting to various things.

So I simplified it to:

If ( Abs ( Get ( SystemPlatform ) ) = 1 ;

Substitute ( Get ( PreferencesPath ) ; "/Preferences/" ; "/Application Support/FileMaker/Extensions/" ) ;

Get ( PreferencesPath ) & "FileMaker/Extensions/" )
 
Bob Stuart   Bob Stuart, Noosa, Queensland
Jan 5, 2010
...and I've just realised that I've backwards-engineered Max's code to exactly what Jens wrote in the first place. Red Face. Apologies, Jens. Will this work in Vista and Win7 ?
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.