Clip Manager 4:Custom Function Installer
What is the Custom Function Installer?
The Custom Function Installer is a tool that gives you more control over the installation of custom functions.
How to use it
First of all, you need to copy some custom functions, either from another FileMaker file, or from a Clip Manager clip.
Secondly, open the "Manage Custom Functions" dialog of the file where you want to install or update those custom functions.
Let's explain by example. We have 3 custom functions. The third one "DoSomething" uses the other custom function "MultipleMoreNumbers".
Now we copy all 3 custom functions by either pressing the "Set" button, or by selecting all custom functions and copying through the contextual menu.
When we activate the "Manage Custom Functions" dialog in FileMaker Advanced 11, we call the Custom Function Installer as described above.
Our HUD window now looks like this, covering the "Manage Custom Functions" dialog.
When we select "AddMoreNumbers" on the left side, the ">>Move>>" button highlights and we can move it to the right side. It disappears on the left side.
If we then select "AddMoreNumbers" on the right pane, the "<<Move<<" button highlights and we can move it to the left side. Since it's not installed yet, it disappears on the right side.
Those actions can also be performed by double-clicking the custom functions.
When we select "DoSomething" on the left pane, the Custom Function installer detects that the formula in this custom function is referring to "MultiplyMoreNumbers" and selects that custom function as well. There's nothing you can do to keep it from doing that.
After moving the selected functions to the right side, you can always decide not to install dependent custom functions by putting them back to the left side. In this case though, that sounds like a bad idea.
As soon as we hit the"Install" button, the HUD window disappears and the custom functions that were moved to the right side, are pasted in FileMaker.
Why you want to update using Custom Function Installer
Allthough FileMaker Advanced 11 supports pasting custom functions, it doesn't support updating existing ones.
If you would paste a custom function for which it's name already exists in the list of already installed custom functions, it would simply paste as the name and an additional index number, creating a second custom function.
Deleting the existing custom function and then pasting is no solution either. FileMaker keeps an internal list of Custom Function ID numbers, and once you delete a custom function, it's ID number can never be used again. Because FileMaker depends on those internal IDs ( this allows you to rename a custom function without anything else breaking, think about it ), all dependent formulas in your file will end up with <missing function> entries.
And you don't want that, do you?
What the Custom Function Installer does to resolve the issue, is paste those custom functions that did not exist yet, and update those that existed already.
It does that by using the newly available Accessibility functions that became available when FileMaker Pro 11 was reprogrammed to use the Cocoa Framework. Allthough it looks like we're back to driving the user interface like we did with Clip Manager 3, things are not what they seem. We're not blindly clicking all over the place like in Clip Manager 3, we're actually able to read and manipulate the FileMaker windows.
This results in much quicker and reliable code, unfortunately this does only work on Mac/FileMaker Pro 11+.
Continuing on the example above, we're updating 2 custom functions while installing a third one. The way it works is best shown in the little movie below:
Open in YouTube.