1.) Boot up your computer.
2.) After your computer is up and running, go to system preferences.(Apple menu/System Preferences)
3.) In System preferences go to Speech.
4.) Turn Speech on.
5.) Make sure the "listen continuously with keyword" option is on and it is set to "Keyword is optional before commands
6.) After you have turned the speech on say "define a new keyboard command" then type in the keyboard shortcut you want to use as a spell, click ok then type in the spell name (e.g. "diffindo" for cut)
Then have a little fun
get out your wand, say the incantation (enunciate!), then wave your wand
If you do not have a wand then you want to check out this instructable