Need help on ssh login script to cisco ios

I'm trying to write a login script to ssh into a cisco switch that will run some command remotely. Similar to this expect script located here:
SSH login expect shell script to supply username and password

However, that script does not work with cisco ios. Anyway know what the best way to approach this?

Thanks

Are you sure that the Cisco switch is ssh enabled? If you just ssh to the box, without the script, can you get in?