Jump to content

Open dialog (specifically, CodeWarrior) working intermittently


cmuw
 Share

Recommended Posts

Hi forum,

I'm struggling with this --- need to script execution of CodeWarrior to compile multiple projects and flash them to a processor (a development board).

I actually I loop through multiple directories with source code, copy files, and then run CodeWarrior to recompile:

#include <File.au3>

Local $files = _FileListToArray ( " ... ", "*", 2)

for $i = 1 to $files[0]

    FileCopy (" .... ", "c:Userspc-adminDocumentsProject1src", $FC_OVERWRITE)

    RunWait ("dcc -c -O ..... list of C files")

        ; I actually need to run an external (command-line) compiler;  in CW, the project includes the .o files

    Local $cw = Run ("c:/Program Files (x86)/Freescale/CW for MPC55xx and MPC56xx 2.10/bin/IDE.exe")

    WinWaitActive ("Freescale CodeWarrior")

    Send ("^o")

        ; Ctrl-O to open the "File Open" dialog box

    Local $dlg = WinWaitActive ("Open")

    Sleep (1000)

    ControlSend ($dlg, "Open", "[Class:Edit]", "c:Userspc-adminDocumentsProject1Project1.mcp")

    Sleep (2000)

    Send ("!o")

        ; Alt-O --- click on the OPEN button after having typed in the project name

Ok, so the problem seems to be around here:  some times, the text is not entered at all  (the dialog

box just freezes --- nothing gets typed in the textbox, and then I can see that the "Open" button is

being pressed, but nothing happens because the filename textbox is empty.

Often enough, I open the Task Manager, forcibly terminate the script (I actually compile it to an

executable, so that it is easier to terminate), and then next time it works like a charm.

Anyone sees any glitches in the above script?  Or any similar experiences with CodeWarrior not

working well with AutoIt?

Thanks,

Carlos

--

 

Link to comment
Share on other sites

Thanks for the reply.

I wasn't sure how to use ControlSend in this situation (the Send I'm using is for Ctrl-O, a shortcut for a menu selection).

But anyway, while investigating a bit given your suggestion, I found WinMenuSelectItem, and this one seems to be working.  Now I'm stumbling into a different problem, but I'll try to figure out what's happening now.

Thanks again!

Carlos

--

Edited by cmuw
Link to comment
Share on other sites

Post the problem your having :)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...