In one way or another, a lot of politics is being played out in courts at the moment. Whether it’s Spain trying to crush the Catalonian independence movement, America frantically trying to impeach its President before he does something REALLY crazy or the UK trying to redefine the most basic of human freedoms out of existence without ever putting an act before Parliament, judges are having as much say as ministers in deciding the future shape of Western civilisation.

Of the most direct interest to Scotland, of course, are the UK government’s attempts to trample all over the 20-year-old devolution settlement.

The urgency of the situation, with Brexit now less than a year away, has driven the Yes movement into one of its occasional paroxysms of dispute about when a second independence referendum should be attempted, with SNP MP Pete Wishart attracting some overheated opprobrium by warning against acting in haste, and in the process serving up a juicy gift-wrapped opportunity for Unionists and a news-starved media.

But the furore masks a key issue that the Yes movement – and more crucially, the Scottish Government – has failed to address for the last three years, and which it’s really going to have to deal with at some point.

Scottish voters consistently say in opinion polls that they think the holding of any more referendums should be a matter for the Scottish Government, not the UK government, to decide – even though most of them still oppose independence and also say they don’t want another indyref in the near future. The current Scottish Parliament has both an electoral mandate and a democratic mandate to call another vote.

There’s only one problem – it doesn’t, at least not in any indisputable sense, have the actual power. And that raises one huge, crucial question:

What if the UK government just says “Now is not the time” forever?

Because there’s very little discernible downside for Westminster in doing so. What’s Scotland going to do about it, elect the SNP again? Elect Labour? LOL, as the young people say. The worst-case scenario for any UK Prime Minister is that they end up with what they’ve already got now – the SNP dominant in Scotland but unable to achieve anything in the House Of Commons against the vast suffocating mass of English MPs.

(And if Labour did somehow win in Scotland, better yet for a UK PM, of either stripe. That way Scotland’s MPs won’t even bother trying to stand up for Scotland, because they’ll be the obedient servants of UK Labour. The Feeble Fifty will ride again.)

The matter of whether a referendum is within the devolved powers of Holyrood has in fact never been settled. There is extensive learned legal opinion on both sides, and the Edinburgh Agreement of 2012 merely avoided answering the question by kicking it down the road and hoping that events would make it go away.

Any referendum attempted without the consent of the UK government would therefore almost certainly find itself in the courts for a long spell of lawyer-enriching wrangling, because any citizen could challenge it even if the UK government itself did not.

So if the UK government simply elects to continue to ignore the democratic wishes of the Scottish Parliament and the Scottish people, the Scottish Government – and more pertinently the SNP – will find itself in a tricky pickle.

Nicola Sturgeon’s current position is unenviably awkward, caught between conflicting strands of public opinion (“no more referendums” vs “Holyrood should have the power to decide”) and the impatience of her own supporters to go back to the polls before the referendum mandate expires in 2021, with few people currently believing that another pro-independence majority will come out of the Scottish election that year.

Barring a UK government change of heart – which seems a long shot to put it mildly – there’s only one Alexandrian sword she can possibly wield to cut through this knot: the courts will have to decide.

So here’s the only way we can see through the problem: the Scottish Government has to bite the bullet and legislate for a second independence referendum now.

It doesn’t have to, and shouldn’t, put a date on it. It just has to pass some sort of bill announcing its intention, any form of preparation that unarguably sets out on the path. The opponents of independence cannot allow that to go unchallenged or they lose the argument by default, so it’ll go to court. And then, after some time passes, we’ll know where we stand one way or the other, once and for all.

Politically it’s unlikely to be a very popular move, but with over three years until any scheduled general elections there’ll never be a better time to swallow that unpleasant medicine. Other than that it costs nothing – if the Scottish Government loses the case, it’ll be no worse off than it is in practice now.

And the longer they wait to start, the more academic the point becomes. It’s a fat lot of good winning the theoretical power for Holyrood to call a referendum if you haven’t got the votes to pass the bill any more. We cannot afford to lose sight of how hard a pro-indy majority at Holyrood is to actually achieve and how lucky we are to have one now.

Because make no mistake, time is running out in all sorts of ways. The clock is ticking on the mandate. The clock is ticking on Brexit. Independence won’t be easy to win in 2019 or 2020, but it’ll be a hundred times harder in 2022 or 2025 – even if by some miracle there’s still a Holyrood majority.

If we let this chance slip past, it’s very difficult to see how another could arrive in less than 20 years. What event could possibly be more seismic than Brexit to justify it, if Brexit doesn’t? (Barring WW3, which would make it a moot point.) And if we’re talking about 2040 then what happens now makes no difference.

As we watch events in Catalonia with horror, we cannot afford to simply sit passively and put our trust in the UK government to play fair if we ask nicely enough. A peaceful, democratic, legal route is open to us. We have to get on that bus and get on our way before the service is cancelled forever.