You should enable the Preference "Enabled Debug Monitor for Scripting" and restart XPression, then try again. You may find you get error messages in the debug monitor like, "Object with Name xxxx not found", or "Material not found" etc.. This will help you determine why your script is not working.
If you post a link to your project/scene/script, I'm sure someone could look and tell you exactly what is wrong.
#XPression