In case this is useful to anyone, or in case anyone spots an error, I had the need today to create a list of active tab panels in a layout to revert to after running a script that could change these.
There is an ‘tabsActive’ custom function on Brian Dunning’s website FileMaker Custom Function: tabsActive ( layoutObjects ) but we are continuing to move away from custom functions now that we have the While() function.
This appears to work upon first testing:
While ( [
//initialVariables
~file = Get ( FileName ) ;
~layout = Get ( LayoutName ) ;
~objects = LayoutObjectNames ( ~file ; ~layout ) ;
~objectCount = ValueCount ( ~objects ) ;
~tab = "" ;
~res = ""
] ;
//condition
~objectCount > 0
;
//logic
[
~tab = If ( GetLayoutObjectAttribute ( GetValue ( ~objects ; 1 ) ; "isFrontTabPanel" ) = 1 ; GetValue ( ~objects ; 1 ) ; "" ) ;
~objectCount = ~objectCount - 1 ;
~objects = RightValues ( ~objects ; ~objectCount ) ;
~res =
Case (
IsEmpty ( ~tab ) ; ~res ;
IsEmpty ( ~res ) ; ~tab ;
~res & ¶ & ~tab
)
] ;
//result
~res
)
Kind regards
Andy