<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Dear Dave<div><br></div><div>Happy new year to you, too.</div><div><br></div><div>Use the property “type” of the window object. The following script iterates through all document windows and flags the ones that are data windows:</div><div>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;"><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(18, 139, 39); background-color: rgb(255, 255, 255);"><span style="color: #000000">w = </span>pf.NextWindow<span style="color: #000000">(0)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;"><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><span style="color: #0000c0">while</span> w != 0:</p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(18, 139, 39); background-color: rgb(255, 255, 255);"><span style="color: #000000">    o = </span>pf.GetWindowObject<span style="color: #000000">(</span><span style="color: #118987">window</span><span style="color: #000000"> = w)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);">    <span style="color: #128b27">print</span> (<span style="color: #535353">"found: "</span>, <span style="color: #118987">o</span>.name)</p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);">    <span style="color: #0000c0">if</span> o.type == <span style="color: #bf5105">pf.dataWindow</span>:</p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(83, 83, 83); background-color: rgb(255, 255, 255);"><span style="color: #000000">        </span><span style="color: #128b27">print</span><span style="color: #000000"> (</span>"   -> is a data window with"<span style="color: #000000">, </span><span style="color: #118987">o</span><span style="color: #000000">.nrRows, </span>"rows and"<span style="color: #000000">, </span><span style="color: #118987">o</span><span style="color: #000000">.nrCols, </span>"columns"<span style="color: #000000">)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(18, 139, 39); background-color: rgb(255, 255, 255);"><span style="color: #000000">    w = </span>pf.NextWindow<span style="color: #000000">(</span><span style="color: #118987">w</span><span style="color: #000000">)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(18, 139, 39); background-color: rgb(255, 255, 255);">        </p><div><br></div><div>Hope this helps.</div><div><br></div><div>Best regards</div><div><br></div><div>Kurt</div><div>QuantumSoft</div><div><br></div><div><br><blockquote type="cite"><div>On 5 Jan 2023, at 20:40, Dave <glasspusher@outofoptions.net> wrote:</div><br class="Apple-interchange-newline"><div><div>Hi folks,<br><span class="Apple-tab-span" style="white-space:pre">        </span><br>Happy new year to all. <br><br>I have a Python script that does some calculations on a data window, and would like to have it act on all data windows that are open. <br><br>I was thinking of iterating through all windows (pf.NextWindow), checking if it was a data window, if so, running the script, but…<br><br>…I don’t see where I can query a window as to if it’s a data window or not<br><br>pf.FrontmostWindow(type) is as close as I see to finding out if a window is a data window, but how do I find out what types all windows are without moving them from the back?<br><br>Maybe I’m missing something. <br><br>Any help is appreciated <br><br>Dave<br><br><br>_______________________________________________<br>proFit-list mailing list<br>proFit-list@quantum-soft.com<br>http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com<br></div></div></blockquote></div><br></div></body></html>