-
Notifications
You must be signed in to change notification settings - Fork 16
/
window.activetab.fmfn
37 lines (26 loc) · 1.1 KB
/
window.activetab.fmfn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
=====================================================
window.activetab( init; theList )
RETURNS: (list) List of all active frontmost tabs.
DEPS: none
NOTES: Original by Koen Van Hulle (SHpartners.com)
=====================================================
*/
Let([
//------------------------- VARIABLES
Init = Init + 1 ;
ObjectList = LayoutObjectNames( Get( FileName ); Get( LayoutName ) ) ;
TabToCheck = Substitute( GetValue( ObjectList; init ); ¶; "") ;
ParentTab = GetLayoutObjectAttribute( TabToCheck; "enclosingObject" ) ;
IsCurrentTab = Case(
IsEmpty( TabToCheck ); 0;
GetLayoutObjectAttribute( TabToCheck ; "isFrontTabPanel" ) and
IsEmpty( ParentTab ); 1;
GetLayoutObjectAttribute( TabToCheck; "isFrontTabPanel" ) and
PatternCount( ¶ & theList & ¶; ¶ & ParentTab & ¶ ); 1;
0 );
theList = theList & If( IsCurrentTab; TabToCheck & ¶ )
];
//------------------------- RESULT
If( not IsEmpty( TabToCheck ); window.activetab( init; theList ); theList )
)