-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwindow.fronttabs.fmfn
39 lines (35 loc) · 1.37 KB
/
window.fronttabs.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
38
39
/*
* =====================================================
* window.fronttabs ()
*
* RETURNS: (list) Return delimited list of frontmost tabs.
* DEPENDENCIES: list.custom(), layout.objects(), list.valueWithin()
* NOTES: Adapted from Agnès Barouh <[email protected]>
* FrontTabsPanelsList()
* =====================================================
*/
Let ([
$function.result = "|###|";
$function.return = ¶;
$function.objects = layout.objects;
var.result = list.custom (
1; // start
ValueCount ( $function.objects ); // end
"Let ( [
var.current = GetValue ( $function.objects; [n] );
var.isFront = GetLayoutObjectAttribute ( var.current; \"isFrontTabPanel\" );
var.enclosing = GetLayoutObjectAttribute ( var.current; \"enclosingObject\" );
var.append = $function.return & var.current;
$function.result = $function.result & Case (
var.isFront and IsEmpty ( var.enclosing ) ; var.append;
var.isFront and list.valueWithin ( $function.result ; var.enclosing ) ; var.append
)
]; False )"
)
];
Substitute ( $function.result ;
[ "|###|¶" ; ""];
[ "|###|" ; "" ]
)
)
& Let ( $function.result = "" ; "" )