May 15, 200718 yr Not sure this is the right forum for this question, but since the answer may require Scriptmaker, here goes. Let's say there are 4 windows open simultaneously in my solution. How can I get the names of the 3rd and 4th windows (where the 1st window is the frontmost and the 4th window is the one behind all the others?) Hope that makes sense. Many thanks--
May 15, 200718 yr You can identify all the window names using WindowNames, and you can identify the front-most window name using Get(WindowName), but there's not a built-in function to identify open windows by their level.
May 15, 200718 yr If no windows are minimized/hidden, then GetValue ( WindowNames ; ValueCount ( WindowNames ) ) should get the backmost window.
May 15, 200718 yr The WindowNames function returns the names of open windows, from frontmost stacking order to rearmost, followed by the names of hidden windows. You can use the GetValue() function to parse the output of the WindowNames function into each window name. For example: GetValue ( WindowNames; 3 ) & ¶ & GetValue ( WindowNames; 4 ) will return the third and fourth window names, assuming there are that many windows open. If you want the last two in the list you would use: GetValue ( WindowNames; ValueCount ( WindowNames ) ) & ¶ & GetValue ( WindowNames; ValueCount ( WindowNames ) - 1 ) I'm not aware of any function that will distinguish between visible windows and hidden windows so the above may return the names of open, but hidden, windows.
May 15, 200718 yr Hi Corn, Please adjust your skill level to Expert, or Certified (which ever is applicable), because you my fried, are no Novice. Nice to have you participating on the Forum, the Forum will be even better because of it. Lee
May 22, 200718 yr Author Many thanks for your responses, everyone. I want to take this a step further now: I want to use a global calc field to get a listing of all open or hidden windows whose WindowName contains the word "fee". How might I accomplish this?
May 22, 200718 yr Hi no global calculation can give an accurate list of window names...the calc must be unstored. A way to obtain what you want is to have two calc fields , both with unstored result: 1) wn = calc field with calc: WindowNames 2) result = repeating calc field with calc: Let( value = GetValue ( Extend ( wn ) ; Get ( CalculationRepetitionNumber ) ); Case( PatternCount ( value ; "fee" ) ; value ; "" ) )
May 22, 200718 yr Author Thanks for your reply. I should mention that the word 'fee' is only a portion of the WindowName. The actual wn might be something like 'Fee | pl.5510' So is it possible to change this line... PatternCount ( value ; "fee" ) ; value ; ...to something like this: PatternCount ( value ; contains the word 'fee' ) ; value ; Obviously the syntax is wrong because I don't know how to do it correctly. I should also mention that if my goal can be accomplished using scripts instead of calc fields, that would be fine too. Thanks again, everyone, for your suggestions. Greatly appreciated.
May 22, 200718 yr But have you tried those calculations ? Because they do exacty what you want, even if "fee" is only CONTAINED into the window name !
May 22, 200718 yr Author Ah - - I found a small error in my formula. You are correct, it works! Now, because it's a repeating field, in repetitions one through five I'm seeing Is there any way I can display the data from the repeating calc field on a layout without the blank repetitions showing?
May 22, 200718 yr I should also mention that if my goal can be accomplished using scripts instead of calc fields, that would be fine too. If you want to set a field ( YourEvenGlobalField ) with a script: Set field [ YourEvenGlobalField ; "" ] Set Variable [$count ; value: 1] Loop Set Variable [$value ; value: GetValue ( WindowNames ; $count ) ] If [ PatternCount ( $value ; "fee" ) ] Set field [ YourEvenGlobalField ; If ( not IsEmpty ( YourEvenGlobalField ) ; YourEvenGlobalField & ¶ & $value ; $value ) ] End If Set Variable [ $count ; value: $count + 1 ] Exit Loop If [ $count > ValueCount ( WindowNames ) ] End Loop
Create an account or sign in to comment