Ian spoke to BBC Somerset's Helen Otter before his talk to a packed-out St Cuthbert's Church.
You can listen to the interview by clicking on this audio link:
Hear Ian talking about the Inspector Rebus novels, his new book - The Naming of the Dead, whether he thinks Rebus and his colleague DS Siobhan Clarke will ever get it together (!), and his writing process.
"I pretty much just make it up as I go along," said Ian.
"I have a theme I want to write about, and usually there's some sort of crime at the beginning which lets me get the ball rolling and allows me to discuss that theme.
"My notes at the beginning of a book would be a few sheets of A4 paper - I store all the information of the crimes in my head and just rely on a few scribbled sheets at the side of my computer."
You can also hear Ian talking about his favourite words, why he likes Rivals by Jilly Cooper so much, the record he made with folk artist Jackie Leven, and the end of the Rebus series of novels.
"Rebus is going to retire next year - I'm going to have a little break from the series and try and write something different.
"Maybe I'll be no good at it, and I'll have to come crawling back to the good old Inspector!"
Ian Rankin is taking part in BBC Somerset's short story competition. Click on this link for more details: