Tips
Tips for asking AI to work in Attelage, and for setting up your custom apps so AI can work with them more easily.
Asking AI to look into your data#
Just ask for what you want to know, such as “Count this month’s meetings by owner.” AI looks into the file, layout and found set of the frontmost window using calculations and ExecuteSQL.
Nothing AI reads is sent to the AI provider until you approve it. You can approve once, for the current turn, or for the conversation. When you expect several lookups in a row, approving for the turn or the conversation means fewer prompts. (Approval for the conversation applies only to [Full Access] accounts while you stay in the same file.)
Refer to tables and fields by their defined names rather than the labels on screen, so AI doesn’t have to guess.
To show the results in the FileMaker Pro window, write in the layout’s fm_annotation how you want AI to handle them. See the next tip, “Writing an fm_annotation.”
Writing an fm_annotation#
Place a text object on the layout, name the object fm_annotation, and write how to work on that layout. When the panel docks to the window, AI reads it and follows those steps whenever they apply to what you ask.
- Use Markdown, and write table, field and script names exactly, enclosed in backticks.
- Write the summary under the heading
## Summary(## 要約also works). Users see it when they click Details… in the banner shown when the panel docks. In two or three lines, describe what users can ask for. - The limit is 4,000 characters. To hide it from users, place it beyond the right edge of the layout or use Hide object when.
# Layout: Order List
## Summary
Finds orders and shows them in a list.
Try “Show yesterday’s orders” or “Find orders from Smith.”
## Purpose of this layout
Find order headers and show them to the user in a list.
## Tables (table occurrence names)
<<ƒ:/*
Returns the structure of the layout's table occurrence as DDL, which AI reads easily.
*/
Let ( [
~toList = Get ( LayoutTableName ) ;
~file = Get ( FileName ) ;
~ddl = GetTableDDL ( JSONMakeArray ( ~toList ; ¶ ; JSONString ) ; True )
] ;
While (
[ ~i = 0 ; ~out = ~ddl ] ;
~i < ValueCount ( ~toList ) ;
[
~i = ~i + 1 ;
~t = GetValue ( ~toList ; ~i ) ;
// Get the base table name from the table occurrence name
~b = ExecuteSQL ( "SELECT BaseTableName FROM FileMaker_Tables WHERE TableName = ?" ; "" ; "" ; ~t ) ;
~b = If ( IsEmpty ( ~b ) or ~b = "?" ; ~t ; ~b ) ;
~cm = BaseTableComment ( ~file ; ~b ) ;
~head = "-- Table: " & ~t
& If ( ~t ≠ ~b ; " (base table: " & ~b & ")" )
& If ( not IsEmpty ( ~cm ) ; ¶ & "-- Description: " & Substitute ( ~cm ; ¶ ; ¶ & "-- " ) ) ;
~key = "CREATE TABLE \"" & ~t & "\" (" ;
~out = Substitute ( ~out ; ~key ; ~head & ¶ & ~key )
] ;
~out
)
)>>
## Showing records to the user
1. Get the target `__recid` values with ExecuteSQL
```
ExecuteSQL ( "SELECT \"__recid\" FROM \"OrderHeader\" WHERE \"Date\" >= ?" ; "" ; "," ; Get ( CurrentDate ) )
```
2. Run the script `gtrr` with a JSON array of `__recid` values as the parameter
- Example parameter: `[12, 15, 31]`
- If nothing is found, don’t run it; say that nothing matched
3. Tell the user how many records were found
## Scripts
| Script name | Parameter | What it does |
| --- | --- | --- |
| `gtrr` | JSON array of `__recid` values | Shows only the given records as the found set |
## Terms
- “This week’s orders” = `Date` within 7 days from today
- “Orders from X” = `OrderHeader::CustomerName` or `OrderHeader::CustomerNameKana`
## Don’t
- Don’t delete records or use Replace Field Contents (if asked, tell the user to do it by hand)
- Don’t read `__recid` values aloud to the userTo check how it was read, ask “Show the fm_annotation.”
Asking AI to run a script#
Give the script name and the parameter, such as “Run the script gtrr with the parameter [12, 15, 31].” If the name is ambiguous, AI searches the file’s script list and suggests candidates. The panel asks you to confirm every run. AI waits up to 60 seconds for the script to finish.
The script below receives the IDs of records that AI found with ExecuteSQL as a JSON array, and shows only those records. In the latest FileMaker Pro, Go to List of Records shows records by their IDs.
- Set Variable [ $param ; Value: Get ( ScriptParameter ) ]
- If [ IsEmpty ( $param ) ]
- Exit Script [ Text Result: 0 ]
- End If
- Go to List of Records [ List of record IDs: $param ; Using layout: <Current Layout> ; Animation: None ]
When a script fails with error 825#
Error 825 means the file doesn’t allow plug-ins to run scripts. Retrying won’t help, so change the file’s settings.
- Open File > Manage > Security.
- Add the extended privilege
fmpluginATLG(Attelage only) and enable it for the privilege set you use. To allow all plug-ins, enablefmplugininstead.
Enabling this extended privilege also allows plug-ins to run SQL in that file. For details, see “About controlling plug-in access between files” in Claris Help.
Functions AI can use without confirmation#
Calculations written by AI are evaluated without confirmation only if they use the functions on the allowlist below. All of them only read data: they don’t change the file and don’t communicate with anything outside it.
Calculations that use other functions (such as Evaluate, plug-in functions and custom functions) or assign $$ variables ask for your confirmation before they run, and only with a [Full Access] account. Other accounts can’t run them. Get options that return paths, IP addresses or account names are not on the list.
Logical
LetIfCaseChooseWhileIsEmptyIsValidIsValidExpressionSetRecursionGetFieldGetFieldNameGetNthRecordGetRepetitionSelfLookupLookupNextGetSummaryGetLayoutObjectAttribute
Text
LeftRightMiddleLengthPositionPatternCountSubstituteReplaceFilterTrimTrimAllUpperLowerProperExactQuoteCharCodeLeftWordsMiddleWordsRightWordsWordCountSerialIncrementGetAsTextGetAsNumberGetAsDateGetAsTimeGetAsTimestampGetAsBooleanGetAsCSSGetAsSVGGetAsURLEncodedTextColorTextColorRemoveTextFontTextFontRemoveTextFormatRemoveTextSizeTextSizeRemoveTextStyleAddTextStyleRemoveRGB
Japanese
HiraganaKatakanaKanaHankakuKanaZenkakuRomanHankakuRomanZenkakuNumToJTextMonthNameJDayNameJYearName
Value lists
ListGetValueValueCountFilterValuesSortValuesUniqueValuesLeftValuesMiddleValuesRightValues
Aggregate and repeating
CountSumAverageMinMaxStDevStDevPVarianceVariancePLastExtend
Number, trigonometric and financial
AbsCeilingFloorIntRoundTruncateModDivSignSqrtExpLnLogLgSetPrecisionCombinationFactorialRandomPiSinCosTanAsinAcosAtanDegreesRadiansFVNPVPMTPV
Date and time
DateTimeTimestampYearMonthDayHourMinuteSecondsDayNameDayOfWeekDayOfYearMonthNameWeekOfYearWeekOfYearFiscal
JSON
JSONGetElementJSONGetElementTypeJSONListKeysJSONListValuesJSONFormatElementsJSONSetElementJSONDeleteElementJSONMakeArrayJSONParseJSONParsedText
Container and encoding
GetContainerAttributeGetHeightGetWidthGetThumbnailVerifyContainerBase64EncodeBase64EncodeRFCBase64DecodeHexEncodeHexDecodeTextEncodeTextDecodeCryptDigest
Design
ExecuteSQLDatabaseNamesFieldBoundsFieldCommentFieldIDsFieldNamesFieldRepetitionsFieldStyleFieldTypeGetNextSerialValueLayoutIDsLayoutNamesLayoutObjectNamesRelationInfoScriptIDsScriptNamesTableIDsTableNamesBaseTableIDsBaseTableNamesValueListIDsValueListItemsValueListNamesWindowNamesGetTableDDLGetFieldsOnLayout
Get options
LayoutNameLayoutNumberLayoutTableNameLayoutViewStateLayoutCountWindowModeWindowNameFileNameFoundCountTotalRecordCountRecordNumberRecordIDRecordOpenStateRequestCountSortStateActiveFieldNameActiveFieldTableNameActiveFieldContentsActiveLayoutObjectNameActiveRepetitionNumberActivePortalRowNumberPageNumberScriptNameCurrentDateCurrentTimeCurrentTimestampCurrentHostTimestampCurrentTimeUTCMillisecondsUUIDUUIDNumberApplicationVersionApplicationLanguageSystemLanguageSystemPlatformSystemVersionDeviceAccountPrivilegeSetNameCurrentPrivilegeSetName
Talking to AI#
Start voice mode with the microphone button on the panel or ⌘⌥⇧M (Ctrl + Alt + Shift + M on Windows). Press it again to stop. Voice mode also stops on its own after two minutes without speech.
- Realtime (Mac and Windows): OpenAI’s GPT listens and speaks. GPT answers small talk itself, and passes anything about FileMaker or your data to the AI selected in the chat, then tells you the answer aloud. You can cut in while it is talking. Requires an OpenAI API key.
- OS (Mac): macOS speech recognition turns your speech into text, sends it to the AI selected in the chat, and reads the answer aloud with a Mac voice. Requires macOS 26 or later.
On a Mac, choose Realtime or OS under Voice mode in Settings…. Approvals for reading data and confirmations for running scripts can’t be answered by voice; when one appears, choose with the keyboard or mouse.
Speak English or Japanese and the answer comes back in the same language. Realtime understands both, whatever the display language. OS mode listens in the display language and reads each sentence with an English or Japanese voice. For a more natural English voice, add an Enhanced or Premium voice in System Settings > Accessibility > Spoken Content > System Voice > Manage Voices.
Making AI answer your way (ATTELAGE.md)#
Write how you like answers, the terms you use and what your work is in a file named ATTELAGE.md, and AI follows it. Attelage reads the file again every time you send a message, so changes take effect right away. The GPT in voice mode Realtime gets it too, so you can also change how it speaks.
The file is in the folder below. Attelage creates a template with instructions the first time it starts.
- Mac:
~/Library/Application Support/Attelage/ATTELAGE.md(in the Finder, choose Go > Go to Folder… and enter~/Library/Application Support/Attelage) - Windows:
%APPDATA%\Attelage\ATTELAGE.md(enter%APPDATA%\Attelagein the File Explorer address bar)
Open it in a text editor and write in Markdown. Anything between <!-- and --> is not sent to AI. The template’s instructions are inside such a block, so you can leave them in place.
## How to answer
- Be polite and brief, and give the conclusion first.
- When answering by voice, speak slowly and calmly.
## About me
- I work in sales. I enter orders and prepare the monthly totals.
- Avoid FileMaker jargon; explain things with the words shown on the screen.
## Terms
- "Accounts" and "clients" both mean our customers.
## Other files
- When I ask for sales totals, read sales.md first.- AI gets only about the first 4,000 characters. If you have more to say, split it into separate
.mdfiles by topic in the same folder, and inATTELAGE.mdjust point to them, such as “When I ask for sales totals, read sales.md first.” AI opens a file only when your request needs it. For a file in a subfolder, write a path such astopics/sales.md - AI can read only
.mdfiles in this folder. It never reads other files or anything outside the folder - To fix the language AI answers in, write something like “Always answer in English.”
- Where it differs from a layout’s
fm_annotation, thefm_annotationwins for how to work with that file or layout - Nothing you write here can skip the approval before data is sent or the confirmation before a script runs
- Examples are in the
samplesfolder in the same place. Attelage overwritessampleswhenever it is updated, so copy what you want to use into the folder above it - Attelage never changes
ATTELAGE.md. If you delete it, Attelage creates the template again the next time it starts
Changing the Realtime voice#
The voice GPT speaks with in Realtime is set by the key Attelage.realtime.voice. The default is marin; others include cedar, alloy, echo and shimmer (the available voices may change at OpenAI’s discretion). The setting isn’t in the Settings dialog, so quit FileMaker Pro and change it as follows.
Mac: run this command in Terminal (the last word, cedar, is the voice name).
defaults write "$(osascript -e 'id of app "FileMaker Pro"')" Attelage.realtime.voice -string cedarTo go back to the default, remove the setting with this command.
defaults delete "$(osascript -e 'id of app "FileMaker Pro"')" Attelage.realtime.voiceWindows: open %APPDATA%\Attelage\settings.json in Notepad or another text editor and add one line inside the outermost { }. Don’t forget the comma at the end of the line before it. To go back to the default, delete the line.
"Attelage.realtime.voice": "cedar"To change how it speaks (speed, tone, how it addresses you), use ATTELAGE.md rather than the voice.
Opening and closing the panel from a script#
The calculation function Attelage_SetPanel opens or closes the panel on the frontmost window: 1 opens it and 0 closes it. Put it at the end of a script that goes to a layout where users ask AI for help, so they can start right away.
- Go to Layout [ “Meeting List” ; Animation: None ]
- # Open the panel (0 closes it)
- Set Variable [ $r ; Value: Attelage_SetPanel ( 1 ) ]
The keyboard shortcut is ⌘⌥⇧X (Ctrl + Alt + Shift + X on Windows).
Checking the license status with a calculation#
Attelage_GetLicenseStatus returns the state, days left and so on, separated by vertical bars (e.g. trial|12|2026-12-25, licensed|1|Registered name). To show the remaining trial days on a layout, use a calculation like this:
Let ( [
s = Substitute ( Attelage_GetLicenseStatus ; "|" ; ¶ ) ;
state = GetValue ( s ; 1 )
] ;
Case (
state = "trial" ; "Trial (" & GetValue ( s ; 2 ) & " days left)" ;
state = "licensed" ; "Registered" ;
state = "expired" ; "Trial has ended" ;
"" // Other states are not shown
)
)