Recording intelligenceAI-generated brief · check the source for context

FileMaker Scripting for Beginners - Day 1 - What not to do

50:49 recording · AUTO · 2 speakers

Watch the original

Watch the original
Executive Summary AI
  • Richard Carlton opens another FileMaker developer day on FM Training TV, which puts out about 600 on-demand videos a year and close to a thousand with live training, and sells courses only as bundles, including a double pack for 349.
  • Guest senior engineer Nick Hunter says he gives pretty much 15% of his time to keeping systems neat, clean and documented, because two or three weeks later nobody remembers what a step was for.
  • Answering Michael Gravel's question about script length, Nick warns that long scripts lose track of context and let you do something terrible like deleting records in the wrong context — he once hunted a bug for five or six weeks until FileMaker 14's script workspace let him break the script into sections and see he was in the wrong context.
  • Nick argues the script name matters even more than the comment: the first word is the action (add, validate, cancel, import, go to), then whether it is a trigger and which event fires it, while Richard insists on numbers because FileMaker identifies scripts and layouts by hidden IDs, and he asks customers for "131" rather than a layout name.
  • The pair then turn on copy and paste, kept only for backward compatibility: a copied social security number sits in the clipboard, a global buffer shared with every application, which is both a breach of security after FileMaker closes and extremely slow, and they close with Nick's renaming hack for moving a script between files, FileMaker's "check for problems" right-click, and custom import orde

Brief overview

Commenting, naming and numbering FileMaker scripts costs time now but saves far more later, two senior developers argue.

  1. Comment why you did it, not only whatRichard writes five verbose lines per description because he may not see that code again for 18 to 24 months and can read that it sets a field but not why.
  2. Script names and numbers beat memoryNick puts the action first so all his validates or adds group together; Richard's customers report problems as "layout 131" instead of a name.
  3. Long scripts hide the context that breaks themNick deleted records — all his invoices — in the wrong context, and only found a weeks-old bug after breaking the script into visual sections.

Questions this recording answers

10 questions, each answered where it is said
How much of your development time should go into commenting and documenting?

Nick gives pretty much 15% of his time to keeping the system behind the scenes neat, clean and documented, and says it is extremely time consuming. Down the road you save a lot of time: two or three weeks later there is no way you remember what you were doing.

How do you actually write a comment inside a FileMaker script?

You put a pound or hashtag sign on the line, then whatever note you want. Comments are things that will not activate; they are purely notes, and only someone writing the script sees them. They help you understand what you were doing and thinking at the time you wrote it.

What should the comment at the top of a script say?

Explain as much as you can. Some scripts have a dependency when you write them: you assume you are on a certain layout before the script is activated. Say that at the top, that this script assumes a certain layout with a certain record, or say there are no dependencies and it runs anywhere.

Why are long scripts a problem?

Nick says with a long script you have trouble keeping track from the top to the bottom, and you carry more risk because you may conflict with what you did before and cannot see clearly which context you are in. He once deleted records in the wrong context and lost all his invoices.

How should you name scripts so you can find them again?

Nick puts the action first: add, validate, cancel, import, show, delete, go to. Then what the script is, such as trigger, then where it fires from, like on layout keystroke or on layout enter. That groups all the validates or all the adds together, so naming extends the comments.

Why number your scripts and layouts if FileMaker ignores the names?

FileMaker does not use the name to know which script or layout to call; it uses a hidden ID number, so every script could share a name and it would still work. The numbering is for us, not FileMaker. Richard asks customers for the number, 131, rather than the descriptive name, because dialogs chop the rest off.

How do you add extra lines inside one comment without adding script lines?

It is the control key with return. Instead of each comment row becoming another script line and pushing you to line 267, you add multiple rows within a single comment, so verbose commenting does not increase your line numbers by ten. Nick expects it is the same on Windows and asks Windows people to confirm.

What numbers does the active modifier key function return?

Nick demonstrates live: pressing no key returns zero, alt returns 8, command returns 16, and alt and command together return 24, which is 16 plus 8. He uses it constantly, for example deleting records with no dialogue when alt is held. Caps lock changes every value, which makes it a nightmare.

What are the risks of using copy and paste in FileMaker?

If you copy something like a social security number, close FileMaker and somebody else goes to that machine, they can see it, which is a breach of security. The other concern is that it is extremely slow, because you suck things out of FileMaker and then pull them back in when you paste.

Can a block of scripts be redirected automatically to another table or module?

There is no easy way, only a hack. In a copy of your original file, rename the relationships, table occurrences, fields and layout exactly the way they are named in the destination file, then copy the script and paste it there. Nick does this all the time and says it saved him hours of work.

Key Quote

“It's very short because when you code, you don't have time to read a novel.”

— Nick Hunter, FileMaker Scripting for Beginners - Day 1 - What not to do, at 12:35
Key Quote

“I'm not going to remember why I did it.”

— Richard Carlton, FileMaker Scripting for Beginners - Day 1 - What not to do, at 16:35
Key Quote

“Some things I think are non-negotiable.”

— Richard Carlton, FileMaker Scripting for Beginners - Day 1 - What not to do, at 18:20

Cite this

“FileMaker Scripting for Beginners - Day 1 - What not to do.” https://www.youtube.com/live/fIC7sapR_j0. Transcript summary by WhipScribe, https://whipscribe.com/transcript-pages/filemaker-scripting-for-beginners-day-1-what-not-to-do.html.

Report this page
What is wrong with this page?