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.
What you need
Section titled “What you need”- A Mac running macOS.
- Alfred installed.
- The Alfred Powerpack, purchased and activated. Snippets are a Powerpack feature.
Install
Section titled “Install”- Open the sureforge-fm-snippets repository on GitHub and download the
FileMaker_Functions.alfredsnippetsfile from the root of the repository. - Double-click the downloaded file. Alfred asks you to import the snippet collection. Confirm the import.
- Open Alfred Preferences, go to Features > Snippets, and make sure Automatically expand snippets by keyword is checked.
- Test it: open a text editor or a FileMaker calculation dialog and type
;fmlet. It should expand into a multi-lineLetstatement.
After import, the snippets appear in Alfred as a collection named FileMaker Functions. Each snippet is named after its function, for example FM Let.
How triggers work
Section titled “How triggers work”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
;fmplus the function name in lowercase. For example,;fmwordcountinsertsWordCount ( ). Getfunctions are;fmgetplus theGetparameter in lowercase. For example,;fmgetfoundcountinsertsGet ( FoundCount ).- Some functions use a different trigger, such as
;fmsubforSubstitute,;fmmidforMiddleand;fmdatefnforDate. 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.
Multi-line blocks
Section titled “Multi-line blocks”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)Snippet reference
Section titled “Snippet reference”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.
Logical
Section titled “Logical”| 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.
Number, aggregate and financial
Section titled “Number, aggregate and financial”| 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).
Date, time and timestamp
Section titled “Date, time and timestamp”| 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.
Container
Section titled “Container”| 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.
Design and miscellaneous
Section titled “Design and miscellaneous”| 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.
Other categories
Section titled “Other categories”These categories follow the standard pattern and insert empty parentheses:
- AI: for example
;fmgetembedding,;fmcosinesimilarity,;fmgettokencountand;fmpredictfrommodel. - Text formatting:
RGB,TextColor,TextFont,TextSize,TextStyleAddand theirRemovevariants. - Trigonometric:
Acos,Asin,Atan,Cos,Degrees,Radians,SinandTan.;fmpiinsertsPi. - Repeating:
Extend,GetRepetitionandLast. - Mobile:
GetAVPlayerAttribute,GetSensor,Location,LocationValuesandRangeBeacons. - Japanese: 12 functions such as
Hiragana,KatakanaandKanjiNumeral.
Get functions
Section titled “Get functions”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 ) |
Customize snippets
Section titled “Customize snippets”You can change any snippet after importing it:
- Open Alfred Preferences.
- Go to Features > Snippets.
- Select the FileMaker Functions collection.
- Double-click a snippet to edit its name, keyword (trigger) or snippet text.
Get updates
Section titled “Get updates”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.
Suggest a snippet
Section titled “Suggest a snippet”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.
Troubleshooting
Section titled “Troubleshooting”- 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.alfredsnippetsagain 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.
Helpful links
Section titled “Helpful links”License, disclaimer and help
Section titled “License, disclaimer and help”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.