These @ernestkoe and @pgcorn's development notes for packing a custom theme as an FileMaker add-on package and then cleaning up the extraneous XML that's in them. This should be scripted eventually.
When FileMaker does a 'save as an add-on', it will generate a folder with XML files that tells FileMaker how to import and create the add-on. The primary file of interest is the template.xml file. Other things like data, language-specific labels are kept separately. The template.xml contains structure AND literal content (CDATA) which makes the file tricky to parse or collapse.
- Update the theme preview image
- Update the
mizu_theme::__versionStringcalculation field in the theme file onfoundations-dev - Update the
FMAddonTemplate_Versionfield on the__FMdAddonTemplate_Metadatalayout - Click the "Generate Add-on" button on the
__FMdAddonTemplate_Metadatalayout to save out the files in your FileMaker application Extensions/AddonModules folder, e.g. `/Users/ernestkoe/Library/Application Support/FileMaker/Extensions/AddonModules' folder (MacOS) - Save the previous
template.xmlfile in thepreviousfolder for later - Copy the generated
proof_mizu_themefolder to the mizu project folder, and use a text editor to remove extraneous objects generated by FileMaker - Run the build script when done.
- Test the add-on
FileMaker saves an image of the layout that you were last on every time you save the saves to the theme globally.
I use the compare feature in VSCode to detect and remove sections that are different.
There are two extra buttons in the Portal element, UUID: 47F1ED16-AADE-4EAA-9D1E-E47CDBED8664
UUIDs of the two extra button:
- XPath:
/FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[11]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[1]/Portal[1]/ObjectList[1]/LayoutObject[7]- Object UUID:
9CC3817A-1A42-4D53-ADF3-40F3F5E07A34
- Object UUID:
- XPath:
/FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[11]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[1]/Portal[1]/ObjectList[1]/LayoutObject[6]- Object UUID:
B2B9D275-B032-411D-A8F6-C4E658BD6ABB
- Object UUID:
Change membercount attribute of Portal object to '5'
Locate the first SlidePanel panel, UUID: B2C37ECE-46F7-4805-84F3-00F525D45B36. This is SlidePanel should have 14 member elements. Instead, we have 17. The last three created are actual duplicates of the button bar buttons. We want to remove them.
- XPath:
/FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[10]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/SlideControl[1]/ObjectList[1]/LayoutObject[1]/SlidePanel[1]/ObjectList[1]/LayoutObject[17]- Object UUID:
D778260F-FA1F-4269-93D0-622D64BA64B5
- Object UUID:
- XPath:
/FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[10]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/SlideControl[1]/ObjectList[1]/LayoutObject[1]/SlidePanel[1]/ObjectList[1]/LayoutObject[16]- Object UUID:
13C82E09-F6C7-4378-B3F2-74C04F6A0637
- Object UUID:
- XPath:
/FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[10]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/SlideControl[1]/ObjectList[1]/LayoutObject[1]/SlidePanel[1]/ObjectList[1]/LayoutObject[14]- Object UUID:
56F2A576-C993-423D-B68D-0C7D28D69D82
- Object UUID:
Set the membercount attribute of the B2C37ECE-46F7-4805-84F3-00F525D45B36 SlidePanel to 14
This should object and it's enclosing children buttons should all be sitting happily within a SlidePanel object. Do not delete these.
- XPath:
/FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[12]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/Portal[1]/ObjectList[1]/LayoutObject[4]- Object UUID:
299056F3-2D15-46C5-AEC6-D2029846EE14
- Object UUID:
- XPath:
/FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[12]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/Portal[1]/ObjectList[1]/LayoutObject[3]- Object UUID:
786F6D8B-0F87-4F89-97B4-4C9046698698
- Object UUID:
Change portal membercount attribute from 5 to 3
This creates the xar .fmaddon archive with the contents of the proof_mizu_theme folder. From within the top level of the mizu project folder, do:
> source build.sh
- uninstall any existing instances of the mizu add-on
- delete the .fmaddon file and the proof_mizu_theme folder from the
FileMaker/Extensions/AddonModulesdirectory - Install the new addon by double clicking the file
- Make a new FileMaker file and try adding the installed add-on to it
- Check to make sure there are no duplicated buttons on the Portal, List, or Tabs layouts.