Well, what script? Did you install it properly?
I have had this problem also with CS6 and found a solution. If I try to open a script UI panel with a project open, I get this message, but if I close the project and then launch the scripts, they write without hassle. Then I re-open my project. Hope that helps.
Yesssss...! Thank you Very much...!
Can anyone help me out? Every time I try and load a script I get this warning "after effects warning: failed to create script panel">
Glad you got it sorted - but one other thing to note:
Some scripts require the following option to be enabled in the preferences:
Preferences > general: "Allow scripts to write files and access network"
It might be worth checking to see if that's related to your issue.