Multi Language - Windows that change name - Any help?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Multi Language - Windows that change name - Any help?

Post by Phil Pendlebury » Wed Jan 24, 2007 11:43 am

Greetings,

I have, at the moment 2 version of my script. As I could not figure out a way to do this. As an example there is part of the English script that does this:

Code: Select all

WaitWindowOpen>Export Audio Mixdown
PushButton>Export Audio Mixdown,Export
WaitWindowClosed>Export Audio Mixdown
However, the German version (for example) needs this:

Code: Select all

WaitWindowOpen>Audio-Mixdown exportieren
PushButton>Audio-Mixdown exportieren,Exportieren
WaitWindowClosed>Audio-Mixdown exportieren
Can anyone suggest the simplest way to put this into one script? The main program window has the same name for both languages. There are only a few dialogs and buttons that have different names.

Would it be simply a case of:

Code: Select all

IfWindowOpen>Audio-Mixdown exportieren
     PushButton>Audio-Mixdown exportieren,Exportieren
     WaitWindowClosed>Audio-Mixdown exportieren
ENDIF
etc.

Or is there a more efficient way to do this?
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Wed Jan 24, 2007 5:32 pm

Well as I need the window wait commands I have done it like this:

Code: Select all

label>butcheckc4s
	  IfWindowOpen>Export Audio Mixdown
        PushButton>Export Audio Mixdown,Export
        WaitWindowClosed>Export Audio Mixdown
		GOTO>butendc4s
      ENDIF
      IfWindowOpen>Audio-Mixdown exportieren
        PushButton>Audio-Mixdown exportieren,Exportieren
        WaitWindowClosed>Audio-Mixdown exportieren
		GOTO>butendC4s
      ENDIF
	  GOTO>butcheckc4s
	  Label>butendc4s
Phil Pendlebury - Linktree

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Jan 24, 2007 9:35 pm

Look into using the window handle instead of the window name.

Not sure how the app is written, but, hopefully, the window handle is the same no matter the name used.

let>WIN_USEHANDLE=1
GetActiveWindow>wHandle,wx,wy


now you can setfocus, etc...by the window handle.....as for the pushbutton commands, do they use the same short-cut keys?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Wed Jan 24, 2007 9:39 pm

SkunkWorks wrote:Look into using the window handle instead of the window name.

Not sure how the app is written, but, hopefully, the window handle is the same no matter the name used.

let>WIN_USEHANDLE=1
GetActiveWindow>wHandle,wx,wy


now you can setfocus, etc...by the window handle.....as for the pushbutton commands, do they use the same short-cut keys?
Thank you again. Something new to look at I believe. I haven't looked at Window Handles yet.

Regarding the keys... I have been using press button - button name (and the buttons are named differently) but your solution may work better. Thank you I will try asap.
Last edited by Phil Pendlebury on Tue May 01, 2018 7:56 am, edited 1 time in total.
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Wed Jan 24, 2007 11:30 pm

Hi again. I have now looked into handles and it would completely solve my long winded problem BUT it has created another problem:

The window in question is a modal dialog type of thing and it's handle changes every time it is opened.

I have tried various methods of getting the handle each time the window is opened but I can't find a reliable way of telling my script which window to get the handle of.

Also the buttons do not have keys to hit. ESC closes the dialog but RETURN will only press the correct button if it has been tabbed to. The problem there is that the number of tabs changes depending on various options. :-)

The name of the buttons also changes per language as does the handle of the buttons each time the dialog is opened.

Can you suggest anything else that I have missed. :-)
Phil Pendlebury - Linktree

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Thu Jan 25, 2007 4:06 am

Sure, just call the publisher of the app and tell them to FIX THINGS!
:lol:

Without having a look at the contents of ViewSystemWindows, I can only tell you what has worked for me. TAKE CONTROL OF THE APP!

Use SetControlText> to completely change the name of the window (maybe always set it to one language or the other) then also use SetControlText> to cycle through the buttons, labels, etc...to ensure they have the names you picked. For instance I have changed the names of OK buttons to GO TEAM in the case when there are multiple OK buttons. VERY COOL is that you can name a button &Rock On and, "presto" you now have a hot key which MacroScript can use to activate that button.

hint: to "cycle" through things like Buttons or Edits, address them one at a time with the instance number, each time checking for ##NOSUCHOBJECT## to be stored in the variable you populate from SetControlText. (which usually means that's all of that type object)...

so, in short (or is it way too late to say that?) You have the ability to Name the Windows, the buttons (including hotkeys), labels, edits, etc...


clear as mud? any questions, just ask again.

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Thu Jan 25, 2007 8:39 am

Wow! Skunk thanks again, another huge amount of stuff to try out... I'll post back if I get any of it working.

Thank you again.
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Fri Jan 26, 2007 9:38 am

Well I have tried and tried but can get no response from Get or Set control text.

I have a feeling this is because the app I am controlling uses non-standard windows etc. (For example Get check box always returns empty as well).

Or maybe I have the syntax wrong.

The window I am trying to control is a modal dialog. Here is the info from Window Viewer:
-657358 - SteinbergModalWindowClass "Export Audio Mixdown"
-----526302 - Button "Choose"
-----985072 - Button "Edit ID3 Tag"
-----1902448 - Button "Close"
-----919420 - Button "Export"
(I have added some "-" to try and get the correct indentation to display here)

As mentioned earlier, the Numbers change each time the box is opened. And the name of the box and buttons change per language.

Does that make sense?
Phil Pendlebury - Linktree

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Jan 26, 2007 1:50 pm

SetControlText>Export Audio*,SteinbergModalWindowClass,1,Meine Fenster

try this bit of code....what happens?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Fri Jan 26, 2007 2:00 pm

Thank you mate but it didn't do anything:

I tried:

Code: Select all

SetFocus>Export Audio Mixdown
SetControlText>Export Audio Mixdown,SteinbergModalWindowClass,1,Meine Fenster
As well just in case... nothing.

Thanks again.
Phil Pendlebury - Linktree

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Jan 26, 2007 2:24 pm

so, your application window still is named Export Audio Mixdown?

and you should ALWAYS use the * at the end of window names...it is just more forgiving when you use the first part of the window name followed by an asterisk.

what is the name of this app? is it something I could download and test?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Fri Jan 26, 2007 2:53 pm

SkunkWorks wrote:so, your application window still is named Export Audio Mixdown?

and you should ALWAYS use the * at the end of window names...it is just more forgiving when you use the first part of the window name followed by an asterisk.

what is the name of this app? is it something I could download and test?
Yes you are right about the "*" but I knew that this window does not change names so i though I would test it anyway.

Yes the window did not change names at all I'm afraid.

The application is Steinberg Cubase 4 - for music production - and there is no free version of any kind. So for you to look at it is out of the question I'm afraid, it is protected by USB dongle and it is very expensive to buy as well - although worth every penny.

Thanks for your help again.

Maybe I could try changing button names? Is that a similar procedure? The button names are in the post I made above although the handes change every time the window is re-opened.

:-)
Phil Pendlebury - Linktree

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Jan 26, 2007 3:32 pm

yes, SetControlText (sct) can be used on buttons and labels as well. You just need to name the window, then the Class (which might be whatever Herr Steinberg chose to call them) then the instance (or sequential occurrence) of that class. So if they call it (according to ViewSystemWindows) a Tx1Bttn and you want to change the 3rd instance of Tx1Bttn

Sct>Steinberg,Tx1Bttn,3,NewText

just to be sure, this is not an Internet Explorer session?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Fri Jan 26, 2007 11:39 pm

SkunkWorks wrote:
just to be sure, this is not an Internet Explorer session?
Not sure what you mean mate? I am using Firefox here...
Phil Pendlebury - Linktree

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Sat Jan 27, 2007 3:12 pm

What I mean is "Is this app browser based"? Firefox, Mozilla, IE, whichever browser you choose.

or is it a desktop application.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts