Your document doesn't contain multiple layouts nor flexible layout, so @h_classen's script doesn't quite apply here/yet. I'm going to move this thread to its own topic.
This is the general approach you can take... hard to know how it went wrong for you without that version though! The explicit steps would be:
- In the Scene Inspector, check the Width Scale 100% box and Height Scale 100% boxes.
- Select all elements by pressing Command-A
- Click the "Group" button in the toolbar
- Now there's a group, but it is a bit bigger than the bounds of the scene since you have elements that extend over it. So you'll just want to use the scene editor to move the top/left/bottom/right boundaries of the group to match the scene.
- Set the Group's Content Overflow in the Metrics Inspector to "Hidden"
- Now we can tell this group how you want it to resize. With just the group selected, go to the Flexible Layout section of the Metrics Inspector. Turn on all the pins, and the resize boxes. You should end up with the preview being a blue box that always entirely fills the shape.
- Now you'll want to check "Zoom contents" in the flexible layout settings. This tells the group to scale all the inner elements when resized.
- And finally set the Scale behavior to "Shrink to fit" - this ensures the contents will always be shown, though may get a little smaller.
There's also some code that you can just paste in a manner similar to your first attempt that basically does the same thing, but for all scenes. You can find it here: