Hi lestroso,
You can use Rev's geometry manager, which you will find in the property inspector, but the GM is unreliable and there will always be a moment when you regret using it. Writing your own scripts is the best solution.
So, yes, you have to write a script for each object. If objects are placed in groups on multiple cards, this is no problem at all. I can imagine that it is quite a lot of work if all your cards are different. In that case, put part of your scripts at card level and another part at stack level. At card level, finish the resizeStack handler with a pass command.
There is no property for automatic resize. You can do this when the stack opens, e.g. in the preOpenStack handler. If you change the stack size by script, while the lockmessages is false, the resizeStack handler will run automatically. If the user resizes the script manually, the resizeStack handler will run as well.
Yes, you can run the preOpenStack handler as you quoted it. It will set the size of the window to the same size as the screen. If this is too big, you can adjust the rect or determine the rect by yourself:
Code: Select all
on preOpenStack
set the rect of this stack to 0,0,600,400
set the loc of this stack to the screenLoc
end preOpenStack
or
Code: Select all
on preOpenStack
put the rect of this screen into myRect
add 64 to item 1 of myRect
add 64 to item 2 of myRect
subtract 64 from item 3 of myRect
subtract 64 from item 4 of myRect
set the rect of this stack to myRect
set the loc of this stack to the screenLoc
end preOpenStack