This is not possible via script in FileMaker, but if you need this effect for printed/previewed/pdf'd layouts:
Select the field and all objects in the same body part below it and use the sliding and visibility section of the Inspector's position tab to set them to slide up and to resize enclosing part.
Key facts about sliding layout objects:
- It's only visible in preview mode and when you print/save as PDF...
- Sliding fields will shrink but not expand.
- All layout objects below and in the same layout part as the slide/resize field need to also be set to slide up and resize.
- Objects in headers and footers will not slide.
- Portals will shrink/slide to fit the number of rows of records, but fields within the portal row will not shrink/slide.
- Fields will slide up only if Top alignment is specified for it and will slide left only if Left alignment is specified.
- Consistent side borders are difficult to achieve with sliding fields.
Thanks, this is good information for when I get to the printing or creating PDF reports. I've decided to create a separate field with repetitive text and put the new or different element in bold which may workout.