One of the things you may notice when you open up the brand new FileMaker Pro 16 is that it looks naked compared to FileMaker Pro 15. The reason is of course that FileMaker Pro 16 has no bottom.
The engineers of FMI removed the bottom status bar from the interface, giving it a clean look, as you can see in the comparison below (drag the slider to see the difference):
This may have some consequences for your scripts. As we were moving our example files to FileMaker Pro 16 we found a problem with the coordinates of objects on the layout in the drag and drop example file of the Troi File Plug-in.
Finding the object coordinates
In the script we were trying to find the position of a rectangle object with the GetLayoutObjectAttribute( ) function. It is important to note that GetLayoutObjectAttribute( ) returns the coordinates relative to the top-left corner of the primary screen’s work area.
This also means that if the status toolbar at the top is visible this function will return different coordinates compared to when it is not visible. For the TrFile_DragAndDrop( ) function you need to supply the coordinates of the drag rectangle relative to the layout.
Trying too hard
We were trying to be clever, by calculating the difference between the window bottom and the coordinates of the rectangle, and then correcting for the bottom status bar. This has been working for a lot of FileMaker versions (since FileMaker Pro 9). But it breaks with FileMaker Pro 16.
To fix this we added a test for the version of FileMaker, and then calculate the offset to the top of the window like this:
If [ $FM_VersionNumber >= 16 ]
# NOTE we add zero: there is no status bar at the bottom
Set Variable [ $vertical_offset;
Value: Get(WindowContentHeight) - Get(WindowHeight) + 0 ]
Else
# Here we adjust for the statusbar at the bottom
Set Variable [ $vertical_offset;
Value: Get(WindowContentHeight) - Get(WindowHeight) + 16 ]
End If
Improved drag and drop example file
This blog post only concentrates on the missing bottom bar of FileMaker Pro 16. You’ll find the actual scripts to implement drag and drop in the example file . You can download the new DragAndDrop.fmp12 (v2.4) example, with the improved scripts here.
Conclusion
FileMaker Pro 16 gives you 16 pixels extra screen at the bottom the layout and a cleaner look too. But be aware of this change in content height. You should review if you are using any calculations that are dependent on this and consider how it may affect your scripts.