Skip to content

SureForge FM Snippets

SureForge FM Snippets is a free collection of Alfred snippets for Claris FileMaker developers on macOS. Instead of typing out a full function or remembering its parameters, you type a short trigger such as ;fmlet and Alfred replaces it with the FileMaker syntax.

The collection has 360 snippets covering FileMaker calculation functions, multi-line Let, Case and While blocks, ExecuteSQL, JSON functions and Get functions. Snippets work in the FileMaker calculation dialog or in any code editor.

The source lives in the public GitHub repository SureForgeTech/sureforge-fm-snippets. It is licensed under the Apache License 2.0.

  • A Mac running macOS.
  • Alfred installed.
  • The Alfred Powerpack, purchased and activated. Snippets are a Powerpack feature.
  1. Open the sureforge-fm-snippets repository on GitHub and download the FileMaker_Functions.alfredsnippets file from the root of the repository.
  2. Double-click the downloaded file. Alfred asks you to import the snippet collection. Confirm the import.
  3. Open Alfred Preferences, go to Features > Snippets, and make sure Automatically expand snippets by keyword is checked.
  4. Test it: open a text editor or a FileMaker calculation dialog and type ;fmlet. It should expand into a multi-line Let statement.

After import, the snippets appear in Alfred as a collection named FileMaker Functions. Each snippet is named after its function, for example FM Let.

Every trigger starts with ;fm, followed by the function name or an abbreviation, all in lowercase. The semicolon is rarely typed directly before letters in normal writing, so snippets are unlikely to expand by accident.

  • Most triggers are ;fm plus the function name in lowercase. For example, ;fmwordcount inserts WordCount ( ).
  • Get functions are ;fmget plus the Get parameter in lowercase. For example, ;fmgetfoundcount inserts Get ( FoundCount ).
  • Some functions use a different trigger, such as ;fmsub for Substitute, ;fmmid for Middle and ;fmdatefn for Date. Every one of these is listed in the reference tables below.

Many snippets insert the function name with empty parentheses, for example JSONSetElement ( ), so you can fill in the parameters yourself. Others insert named placeholders, such as Left ( text ; numberOfCharacters ), that you replace with your own values.

Three snippets insert a ready-made, indented block.

;fmlet inserts:

Let ( [
var = value
] ;
result
)

;fmcase inserts:

Case (
test1 ; result1 ;
test2 ; result2 ;
defaultResult
)

;fmwhile inserts:

While ( [
i = 0 ;
result = ""
] ;
i < count ;
[
i = i + 1 ;
result = List ( result ; i )
] ;
result
)

The tables below list every snippet that inserts placeholders or uses a different trigger. The rest of each category follows the standard pattern: ;fm plus the function name in lowercase, inserting the function name with empty parentheses. The full list, with every trigger and expansion, is the file data/FileMaker_Functions_Alfred_Snippets.csv in the repository.

Trigger Inserts
;fmif If ( test ; resultIfTrue ; resultIfFalse )
;fmcase Multi-line Case block (see above)
;fmlet Multi-line Let block (see above)
;fmwhile Multi-line While block (see above)
;fmchoose Choose ( test ; result0 ; result1 ; result2 )
;fmeval Evaluate ( expression )
;fmsql ExecuteSQL ( "SELECT field FROM table WHERE id = ?" ; "" ; "" ; id )
;fmsqle ExecuteSQLe ( "SELECT field FROM table WHERE id = ?" ; "" ; "" ; id )
;fmgetfield GetField ( fieldName )
;fmisempty IsEmpty ( expression )
;fmisvalid IsValid ( expression )
;fmself Self

Also included: EvaluationError, GetAsBoolean, GetNthRecord, GetSummary, IsValidExpression, Lookup, LookupNext and SetRecursion.

Trigger Inserts
;fmsub Substitute ( text ; [ searchString ; replacementString ] )
;fmpos Position ( text ; searchString ; start ; occurrence )
;fmpattern PatternCount ( text ; searchString )
;fmleft Left ( text ; numberOfCharacters )
;fmright Right ( text ; numberOfCharacters )
;fmmid Middle ( text ; start ; numberOfCharacters )
;fmleftwords LeftWords ( text ; numberOfWords )
;fmfilter Filter ( textToFilter ; filterText )
;fmfiltervals FilterValues ( textToFilter ; filterValues )
;fmgetvalue GetValue ( listOfValues ; valueNumber )
;fmvaluecount ValueCount ( listOfValues )
;fmsortvals SortValues ( listOfValues ; dataType ; locale )
;fmunique UniqueValues ( listOfValues )
;fmastext GetAsText ( expression )
;fmasnum GetAsNumber ( expression )
;fmasdate GetAsDate ( expression )
;fmasts GetAsTimestamp ( expression )
;fmtrim Trim ( text )
;fmlower, ;fmupper, ;fmproper Lower ( text ), Upper ( text ), Proper ( text )
;fmquote Quote ( text )

Also included: Char, Code, Exact, GetAsCSS, GetAsSVG, GetAsTime, GetAsURLEncoded, LeftValues, Length, MiddleValues, MiddleWords, Replace, RightValues, RightWords, SerialIncrement, TrimAll and WordCount.

All ten JSON snippets follow the standard pattern and insert empty parentheses. Note that the trigger uses the full function name: ;fmjsonsetelement inserts JSONSetElement ( ).

Included: JSONDeleteElement, JSONFormatElements, JSONGetElement, JSONGetElementType, JSONListKeys, JSONListValues, JSONMakeArray, JSONParse, JSONParsedState and JSONSetElement.

Trigger Inserts
;fmabs Abs ( number )
;fmceil Ceiling ( number )
;fmfloor Floor ( number )
;fmmod Mod ( number ; divisor )
;fmround Round ( number ; precision )
;fmrandom Random
;fmavg Average ( field {; field...} )
;fmcount Count ( field {; field...} )
;fmsum Sum ( field {; field...} )
;fmlist List ( value1 ; value2 ; value3 )
;fmmax Max ( number1 ; number2 ; number3 )
;fmmin Min ( number1 ; number2 ; number3 )

Also included: Combination, Div, Exp, Factorial, Int, Lg, Ln, Log, SetPrecision, Sign, Sqrt and Truncate (number); StDev, StDevP, Variance and VarianceP (aggregate); FV, NPV, PMT and PV (financial).

Trigger Inserts
;fmdatefn Date ( month ; day ; year )
;fmtimefn Time ( hours ; minutes ; seconds )
;fmtimestamp Timestamp ( date ; time )

Also included: Day, DayName, DayOfWeek, DayOfYear, Month, MonthName, WeekOfYear, WeekOfYearFiscal, Year, Hour, Minute and Seconds.

Trigger Inserts
;fmtextenc TextEncode ( text ; encoding ; lineEndings )
;fmtextdec TextDecode ( container ; encoding )

Also included: the Base64 and Hex encode and decode functions, the Crypt functions (such as CryptDigest and CryptEncrypt), GetContainerAttribute, GetHeight, GetWidth, GetThumbnail, GetLiveText, GetLiveTextAsJSON, GetTextFromPDF, ReadQRCode and VerifyContainer.

Trigger Inserts
;fmfieldnames FieldNames ( fileName ; layoutName )
;fmlayoutnames LayoutNames ( fileName )
;fmscriptnames ScriptNames ( fileName )
;fmtablenames TableNames ( fileName )
;fmfieldname GetFieldName ( field )

Also included: the other design functions (such as BaseTableNames, FieldType, LayoutObjectNames, RelationInfo, ValueListItems and WindowNames) and miscellaneous functions such as ConvertToFileMakerPath, GetBaseTableName and GetRecordIDsFromFoundSet.

These categories follow the standard pattern and insert empty parentheses:

  • AI: for example ;fmgetembedding, ;fmcosinesimilarity, ;fmgettokencount and ;fmpredictfrommodel.
  • Text formatting: RGB, TextColor, TextFont, TextSize, TextStyleAdd and their Remove variants.
  • Trigonometric: Acos, Asin, Atan, Cos, Degrees, Radians, Sin and Tan. ;fmpi inserts Pi.
  • Repeating: Extend, GetRepetition and Last.
  • Mobile: GetAVPlayerAttribute, GetSensor, Location, LocationValues and RangeBeacons.
  • Japanese: 12 functions such as Hiragana, Katakana and KanjiNumeral.

The collection includes 135 Get functions. Each trigger is ;fmget plus the parameter name in lowercase:

Trigger Inserts
;fmgetcurrentdate Get ( CurrentDate )
;fmgetaccountname Get ( AccountName )
;fmgetscriptparameter Get ( ScriptParameter )
;fmgetlasterror Get ( LastError )
;fmgetlayoutname Get ( LayoutName )
;fmgetuuid Get ( UUID )

You can change any snippet after importing it:

  1. Open Alfred Preferences.
  2. Go to Features > Snippets.
  3. Select the FileMaker Functions collection.
  4. Double-click a snippet to edit its name, keyword (trigger) or snippet text.

The repository is where new and corrected snippets are published. To get the latest collection, download the current FileMaker_Functions.alfredsnippets file from the repository and import it as described in Install. If you have edited snippets in Alfred, make a note of your changes first.

Contributions are welcome as issues or pull requests; pull requests need a DCO sign-off (git commit -s). All snippet data is kept in data/FileMaker_Functions_Alfred_Snippets.csv. To propose a new snippet or a change, open an issue, or edit the CSV file and open a pull request. You do not need to build the .alfredsnippets file yourself; the maintainers regenerate it after a change is merged.

New triggers must start with ;fm, be all lowercase, stay short but descriptive, and not clash with an existing trigger. Snippet text should match the syntax in the official Claris documentation. See docs/CONTRIBUTING.md in the repository for the full guidelines.

  • Nothing happens when I type a trigger. Check that the Powerpack is active and that Automatically expand snippets by keyword is checked under Features > Snippets in Alfred Preferences.
  • The collection is missing. Double-click FileMaker_Functions.alfredsnippets again and confirm the import.
  • A trigger does not exist. Some functions use a shortened trigger, and JSON triggers use the full function name (for example ;fmjsonsetelement). Check the tables above or the CSV file in the repository.

SureForge FM Snippets is licensed under the Apache License 2.0. See the LICENSE file in the repository.

For questions, bugs or snippet requests, open an issue in the GitHub repository or visit Support. To report a security issue, use the repository’s private vulnerability reporting under the Security tab instead of a public issue.