Saubs Posted May 15, 2007 Posted May 15, 2007 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--
Ender Posted May 15, 2007 Posted May 15, 2007 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.
comment Posted May 15, 2007 Posted May 15, 2007 If no windows are minimized/hidden, then GetValue ( WindowNames ; ValueCount ( WindowNames ) ) should get the backmost window.
corn Posted May 15, 2007 Posted May 15, 2007 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.
Ender Posted May 15, 2007 Posted May 15, 2007 Hey, I didn't realize they were in order. Thanks for the info.
Lee Smith Posted May 15, 2007 Posted May 15, 2007 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
Saubs Posted May 22, 2007 Author Posted May 22, 2007 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?
Raybaudi Posted May 22, 2007 Posted May 22, 2007 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 ; "" ) )
Saubs Posted May 22, 2007 Author Posted May 22, 2007 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.
Raybaudi Posted May 22, 2007 Posted May 22, 2007 But have you tried those calculations ? Because they do exacty what you want, even if "fee" is only CONTAINED into the window name !
Saubs Posted May 22, 2007 Author Posted May 22, 2007 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?
Raybaudi Posted May 22, 2007 Posted May 22, 2007 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
Recommended Posts
This topic is 6396 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now