Expect: run a command first before sending

Hello Expect experts,

Is it possible with Expect to run a command first when an expected phrase is
outputted by a spawned program? Before sending an answer to the spawned program that is...

Thanks a lot.

I know the answer is yes, but I don't know expect well enough to tell you how to do it. It is based off of tcl if you happen to know how script/program in tcl/tk.

No, i'm afraid not. I'm a complete script noob. :-L