The Nightmare Before Christmas Had Its Songs Ready To Go Before The Script Was Even Ready
Before "The Nightmare Before Christmas" became a cult stop-motion animated film that spawned an entire franchise of clothing, music, and video games, it was a poem written by Tim Burton, who was then a Disney employee (via Far Out Magazine). The House of Mouse considered developing Burton's poem into a Christmas special, but nothing ever came of it. Burton was eventually fired from the company in 1984 (via AMC Theatres).
However, after Burton found commercial success directing "Beetlejuice" and the first two Michael Keaton "Batman" films, he revisited the concept of a Pumpkin King of Halloween Town who takes over Christmas. Discovering Disney still owned the rights to his poem, Burton started developing the film with Henry Selick attached as director.
Selick made many of the creative decisions on the film, but Burton and frequent collaborator Danny Elfman decided "The Nightmare Before Christmas" would be a musical (per Cartoon Research). In fact, the songs were finished before the dialogue was.
Danny Elfman had the songs finished before the first screenplay draft was completed
Danny Elfman, who had composed the scores for each of Tim Burton's previous films, including the 1989 "Batman" theme, found writing the music and lyrics for "The Nightmare Before Christmas" easy. "With this film, we talked about each little bit and I was hearing the songs before he was even out the door," Elfman said (via Cartoon Research).
The songs, including "What's This?" and "Oogie Boogie's Song," were largely composed before there was a script. Elfman helped Burton flesh out the story of the film and its emotional structure with his music. Then, when most of the songs were done, Burton asked Caroline Thompson, who'd written "Edward Scissorhands," to work on the script.
As Burton admits, this was a strange process, but it turned out to be wildly successful, as "The Nightmare Before Christmas" is now considered a classic and has a huge following to this day.