content: function run(){function v(e,x){var f=e.tree(),w=f.tags().sort(),b,a=[],h,c,d,m=0;b=0;for(var k=x.filtered,l=w.length,g=0;g<l;g++){h=w[g];b=f.evaluateNodePath("//@"+h);d=b.length;m=0;for(c=d;c--;)e.nodeIsHiddenInFold(b[c])&&(m+=1);b=d-m;k?a.push(m?"@"+h+"\t"+b+"/"+d+" \u2192 focus":"@"+h+"\t"+d+" \u2192 hide"):a.push("@"+h+"\t"+b+"/"+d+" \u2192 focus")}return a}function y(e,a){var f;a:{var c=a.choice,b,g;f=[];for(var h=[],l=a.view.path,d="",m,k=b=0,k=c.length;k--;)if(b=c[k],-1!==b.indexOf("\t"))b=
  c[k].split("\t"),g=b[1].split("/"),m=g[0],g=g[1],m<g?f.push(b[0]):h.push(b[0]);else if("SHOW ALL"===b){f={path:"///*",hidden:h,focused:f};break a}b=f.length;k=h.length;b||k||(f=a.view.focused,h=a.view.hidden,b=f?f.length:0,k=h?h.length:0,b||k||(d=l));b&&(c=1<b?"("+f.join(" or ")+")":f[0],d="//"+c,a.subtreefocus&&a.pathfocus?d="/"+d+" union //"+c+"/descendant::*":(a.subtreefocus&&(d+="/descendant-or-self::*"),a.pathfocus&&(d+="/ancestor-or-self::*")));k&&(c=1<k?"("+h.join(" or ")+")":h[0],d=d?d+(" except //"+
  c):"//* except //"+c,a.subtreehide&&(d+="/descendant-or-self::*"));f={path:d,hidden:h,focused:f}}e.setNodePath(f.path);return f}function z(a){return a.nodePath().toString()}var q=!0,r=!1,s=!0,t=Application("FoldingText"),l=t.documents(),u={},g=l.length,l=g?l[0]:null,n="///*",a=[],e=[],c=!0,p;if(g&&(g=l.evaluate({script:z.toString()}),e=l.evaluate({script:v.toString(),withOptions:{filtered:"///*"!==g}}),t.includeStandardAdditions=!0,a=e.length))for(a=e[a-1];c;){e.push("");e.push(r?"[+] include descendants in focus":
  "[  ] include descendants in focus");e.push(s?"[+] include ancestors in focus":"[  ] include ancestors in focus");e.push(q?"[+] hide descendants too":"[  ] hide descendants too");e.push("");e.push("SHOW ALL");t.activate();for(p=a.length;p--;)c=a[p],isNaN(c)||(a[p]=e[c]);if(c=t.chooseFromList(e,{withTitle:"View/hide tagged nodes in FT 1.2",withPrompt:"active node path:\n\n"+g+"\n\n( visible / total ) \u2192 action\n\n\u2318-click for multiple tag(s):",defaultItems:a,multipleSelectionsAllowed:!0})){a=
  [];for(p=c.length;p--;)n=c[p],a.push(e.indexOf(n)),-1!==n.indexOf("descendants")?-1!==n.indexOf("focus")?r=!r:q=!q:-1!==n.indexOf("ancestors")&&(s=!s);u=l.evaluate({script:y.toString(),withOptions:{view:u,choice:c,subtreehide:q,subtreefocus:r,pathfocus:s}});g=n=u.path;e=l.evaluate({script:v.toString(),withOptions:{filtered:"///*"!==g}})}}return n};