A tale I heard
Aladdin animator Eric Goldberg on securing Robin Williams for the role of the Genie:
"John Musker and Ron Clements wrote the script. And they have the gift to be able to write in the voices of the actors they would like to cast. So they hadn’t cast Robin yet, but they wrote it as if Robin had been cast when you’re reading the Genie in the script. But they hadn’t signed him yet, so they asked me, “Why don’t you animate a Genie to some of Robin’s comedy riffs off one of his albums?” So I did and they brought Robin Williams in to look at it, and it’s one of the greatest moments of my life to make Robin laugh. And then after that, he signed. So I was tickled pink and tickled pink just to be at the recording sessions."