ADAM McNamara enjoyed watching television cop shows when he was growing up in Dundee. When he signed up to become one of the boys in blue, however, any resemblance to the on-screen action was incidental. A decade since he left the force to train as an actor, and with stints onstage in Black Watch and more recently on the West End in Harry Potter and the Cursed Child under his belt, McNamara has attempted to set the record straight.

His script, Stand By, is an intense and claustrophobic new work, which attempts to show the tedium and frustration of a thin blue line on the verge of action, but forced to hang fire until the moment is right. Rather than give vent to the on-stage equivalent of car chases and gun-toting stand-offs, McNamara's play aims to get behind the police's public image.

“It's not a cop drama,” he says on a break from the first read-through of the play earlier this week. “It's about the humans behind the uniform. Having been a cop, I always felt watching them on TV that there was something missing, and the portrayals of them were kind of stuffy. I thought I'd have a go at doing something that showed off some of the humanity that exists among police. Their lives can be pretty dramatic without all the cliches that come out on the TV.”

The roots of Stand By stem from a TV drama McNamara tried to write which featured a few scenes in the back of a police riot van. It was these that stuck out for Black Watch writer Gregory Burke when McNamara showed him his script in search of advice.

“The seed was planted, and a few days later I came up with the idea of having four cops in a riot van waiting for the disposal of a situation.”

This particular situation is a domestic dispute, in which negotiators are attempting to reason with a man wielding a samurai sword holed up in his flat. Out of this, the audience get to witness what McNamara calls “a pressure cooker situation, with all the frustration, comedy and internal politics between the police that brings out.”

What is unique in the story's telling is that the audience get to eavesdrop on action which the characters onstage are not party to through ear-pieces which they wear throughout the performance.

“I don't think this is something that's ever been done in theatre before,” says McNamara. “It's airwave radio, so you can hear some information before the people onstage do.”

Stand By is produced by Utter, the company formed by director Joe Douglas, and is being presented in association with the Byre Theatre, St Andrews, where it previews prior to an Edinburgh Fringe run as part of the Made in Scotland showcase of home-grown work. It also forms part of Army @ The Fringe, a British Army initiative, which features Stand By alongside five other professional works with military themes in a drill hall in Edinburgh's New Town as part of Summerhall's off-site programme.

Such a setting may not be too far removed from McNamara's early days as a fitness instructor prior to him joining the police aged twenty-three. Having wanted to be an actor since an early age, he joined an amateur dramatic group with a colleague before applying for drama school.

“As much as I loved being in the police, there were elements I'd started to dislike,” he says. “All the bureaucracy made it feel like I'd joined a secondary rat race, and it seemed like there was far too much paperwork going on when I'd rather be out catching criminals.”

As an actor, McNamara has perhaps understandably been cast as a fair few policemen on-screen, including in several episodes of EastEnders. In terms of any TV cop shows that served up something resembling reality as Stand By is attempting to do, it is hard not to think of The Cops, which ran over three series in the early 2000s. The documentary-style programme, overseen in part by Scots director Kenny Glenaan, was controversial enough for the sort of official police advice that is standard for police dramas to be withdrawn for the second series. In this respect, McNamara's presence makes Stand By something of an inside job.

“My aim is to try and write something that's never been written about before,” he says. “A lot of police men and women are restricted from having an opinion, but I don't have to worry about that anymore, so I can say what I like about how things really are.”

Stand By, Byre Theatre, St Andrew's, August 4-5; Summerhall, Edinburgh, as part of Army @ The Fringe, August 11-26, 6.45-8pm. The play tours Scotland in the autumn.

www.summerhall.co.uk