5 May 2016 Last updated at 08:32 BST
The cops even threw in some Scottish country dancing to add their own twist.
The Scottish force has now challenged police in London and Toronto, Canada, to get their groove on too.
The viral craze sees people recording themselves dancing to My Boo by Ghost Town DJs, posting the video on social media and then challenging others to join in.

Their comments follow Mrs May's claim she was "here for the long term".
Labour said she was "deluding herself" - but Foreign Secretary Boris Johnson led her defence, insisting she could win an absolute majority.
However, ex-Conservative Party chairman Grant Shapps said it was "too early to be talking about going on and on".
"The truth is we ran a very poor election and you can't just brush that under the table and pretend it didn't happen - not least because we went from having a workable majority to no majority at all, so that stands to reason," he told BBC Radio 4's Today programme.
And while there was no mood for a leadership election, Mrs May's remarks "will certainly raise some eyebrows".
"Let's get some performance, let's get some delivery for the British people and then let's see where we are, rather than vice versa," Mr Shapps added.
Debate over Mrs May's long-term ambitions was sparked after she told the BBC's Ben Wright in Kyoto that it was her intention to lead her party into another general election, whenever that was.
"Yes, I'm here for the long term. What me and my government are about is not just delivering on Brexit but delivering a brighter future for the UK," she said.
Mrs May said she wanted to ensure "global Britain" could take its trading place in the world, as well as dealing with "those injustices domestically that we need to do to ensure that strong, more global, but also fairer Britain for the future"
The prime minister has been under pressure after losing her Commons majority in a snap election called earlier this year.
Some reports had suggested she could stand down in 2019 after EU withdrawal.
But speaking on a visit to Nigeria, Mr Johnson, who received public backing from Mrs May after recent criticism of his performance, said: "I've made it clear I'm giving my undivided backing to Theresa May.
"We need to get Brexit done.
"She's ideally placed to deliver a great outcome for our country and then deliver what we all want to see, which is this exciting agenda of global Britain.
"I think she gets it.  She really wants to deliver it.  I'm here to support her."
The UK is due to leave the EU in March 2019 and supporters of Mrs May have said leadership speculation serves only to undermine attempts to secure the best possible terms of exit.
Shadow Cabinet Office minister Jon Trickett said the prime minister was "deluding herself" about her plan to stay in power until the next election.
"Neither the public nor Tory MPs believe her fantasy of staying on till 2022," he said.
"Theresa May leads a zombie government."
The next general election is not scheduled to take place until May 2022, by which point Mrs May - if she stayed in Downing Street - would have been prime minister for nearly six years.
In the immediate aftermath of her party's failure to win June's general election outright, several MPs called on her to consider her position.
Former Chancellor George Osborne, who has become a newspaper editor after being sacked by Mrs May, said she was a "dead woman walking".
The prime minister has sought to consolidate her position by negotiating a governing agreement with the Democratic Unionists and overhauling the way Downing Street works, replacing key advisers.
But this has not stopped speculation about how long she might remain in Downing Street and about potential successors, although one cabinet minister earlier this summer blamed such talk on too much "warm prosecco".
The prime minister faces a crucial few months with a number of tests of her authority within the party, including her second conference speech as party leader in October and key Brexit votes in the Commons.
Newspapers reports over the weekend claimed Mrs May had told MPs that she intended to stand down in the summer of 2019 to give her successor ample time to bed in before the next election.
No 10 dismissed the reports as "peak silly season".
On the second day of her trip to Japan, Mrs May will hold official talks with her counterpart Shinzo Abe and emphasise the growing security links between the two countries.
Police officers in Scotland's capital city, Edinburgh, have taken on the Running Man Challenge.
[NEXT_CONCEPT]
Some Conservative backbenchers have said they do not believe Theresa May will be able to fight the next general election as prime minister.