Taylor Swift had already been cast as Bombalurina in the upcoming film version of "Cats" directed and written by Tom Hooper. Now, Swift was given an important role as a songwriter for the film.

The original composition "Beautiful Ghosts" was co-written by Swift and "Cats" Executive Producer and Composer Andrew Lloyd Webber.

With the song, Swift and "Cats" could find themselves nominated for the Oscar award's best original song for a film.

Swift Gets In the Mind of Victoria

It was a matter of being prepared and in the right place at the right time for the singer-songwriter. Variety reported that even on days when Swift doesn't have work, she reportedly lingered on the set of "Cats" -- intrigued by prima ballerina Francesca Hayward on her role as Victoria, The White Cat.

In the film, Victoria's role was elevated to a lead cat, prompting a need to write an original song. Rumors allegedly reached Swift that Webber was working on a musical piece for an original song for Victoria, but lyrics were still needed.

In an interview with Zayne Lowe, Swift recalled how she had never heard of the music Webber was making for Victoria. Nonetheless, she knew The White Cat would be singing after Jennifer Hudson's character Grizabella sings "Memory."

So Swift reportedly observed Victoria's storyline on set for many weeks and contemplated on what the abandoned young kitten -- once adored and now alone -- would be thinking about losing everything, but memories. Being a cat owner, Swift thought, "I know what that cat would say!" She knew the young kitten would hold on to those memories.

The Perfect Song

Hooper was thrilled with Swift's readiness in helping out creating the song. He also noted that Taylor came in with a "profound understanding" of what they are trying to achieve with the film.

In a clip shared by Universal Pictures, Webber revealed that when he first read the screenplay where the film is seen through Victoria's eyes, he knew that an original song would play an important and central part of the film.

Hooper praised Swift's lyrics for being "extraordinarily beautiful." Meanwhile, Swift said that Webber exclaimed "Beautiful Ghosts" is the perfect song they wanted Victoria to sing upon hearing it.

Taylor Swift also sang a studio recording of "Beautiful Ghosts," which would be played at the end credits of the film.