THE SNP’s bumpiest year in office illustrated the utter folly of all New Year resolutions.

Whatever Nicola Sturgeon had planned at the start of 2017, it’s a fair bet it didn’t include an on/off referendum, a snap General Election and her party’s worst electoral reverse in 40 years, or a slump in relations with Alex Salmond.

Yet all came to pass, with lasting consequences.

On the achievement side, the First Minister notched up a decade in government, set out a dynamic legislative programme, won a five-year battle over alcohol pricing, and set Scotland on a distinctive path to a “progressive” tax regime But it was the errors and setbacks for this usually surefooted politician that stood out.

Within hours of the UK-wide vote for Brexit in June 2016, Ms Sturgeon had been predicting a second independence referendum was “highly likely”.

The tempo quickened in January 2017, not just for the SNP. Looking ahead to May’s council vote, then the only election on the horizon, the Unionist parties decided to focus on Ms Sturgeon and turn the local poll into a proxy vote, effectively a referendum on having a second referendum.

It was a straw in the wind, but the First Minister seemed not to notice.

She was also preoccupied with other things, notably a revolt against business rates.

Finance Secretary Derek Mackay calmed the situation with a £45 million package of reliefs, but the episode set a hare running that would vex the SNP for the rest of the year.

Mr Salmond, whose strong links with business while he was first minister would never have seen him caught off guard like Mr Mackay, took a rare public stand against the Government.

The then MP said there were cases of “genuine concern”. It was a glimpse of a tension between the old guard and the new that would later overflow.

On March 13, Ms Sturgeon stood in the drawing room of Bute House and said that in order to offer Scots a choice between Brexit within the UK and independence, she planned to hold a referendum between autumn 2018 and spring 2019.

It was rocket-fuel for the opposition parties, who had already put a theoretical threat of a referendum at the heart of the council elections. Now it was an imminent danger.

A week later, the Scottish Parliament voted 69 to 59 to seek referendum powers from Westminster. Ms Sturgeon famously posed on a sofa signing the letter to the Prime Minister. She never got a reply.

Downing Street stuck rigidly to its “now is not the time”

mantra. The SNP huffed and puffed, but was not too perturbed in private, seeing it as a war of attrition.

By the time Brexit came into view, the Nationalists hoped to have moved public opinion in their favour, forcing the UK Government to concede.

But in April, it was Theresa May’s turn to get behind a lectern and stun the country.

The timing of the snap election she announced in Downing Street, as Mr Salmond later acknowledged, was “completely wrong” from the SNP’s point of view.

Not so for the Unionists, who could simply keep the anti-referendum messages intended for the local poll in May running all the way to the General Election in June.

The SNP won in May, but not the way they hoped, going from 425 to 431 councillors, their share of first preference votes static on 32.3 per cent.

They took Glasgow from Labour, but failed to win a majority, and suffered losses in the four council areas that voted Yes in 2014.

There was no anti-Brexit, pro-referendum bounce.

Meanwhile, the Tories went from 115 councillors to 276, and pushed Labour into third.

They also picked up seats in previous no-go zones such as Ferguslie Park and Shettleston.

Ruth Davidson used the results to talk up her party’s chances in June, targeting Mr Salmond in Gordon and SNP Westminster leader Angus Robertson in Moray.

Despite the Tory council surge, Ms Sturgeon doubled down on independence, saying a win in June would give her a “triple lock” on a referendum.

She also made Mrs May’s mistake of writing off Labour leader Jeremy Corbyn. As his poll numbers and crowds got bigger, she scrambled to change tack, saying she would help him enter Downing Street.

In the closing hours of the campaign, Ms Sturgeon’s nerves showed as she landed one of the lowest blows of the election, claiming in a live TV debate that Kezia Dugdale told her in a private conversation after the Brexit vote she was open to a second referendum.

From the high-water mark of 2015, when it won 56 of 59 seats, the SNP fell to 35 MPs after losing half a million votes and seeing its vote share slide from 50 to 37 per cent.

Mr Salmond, Angus Robertson and 19 other SNP candidates were sent packing as voters backed the opponent most likely to defeat them.

Thanks in large part to tactical anti-SNP voting, the Tories gained 12 seats, Labour six and the LibDems three.

Mr Salmond had his 30-year parliamentary run terminated by the biggest move to the Conservatives in the UK.

Ms Sturgeon admitted her referendum plan had “undoubtedly” been a factor.

Unusually for the SNP, there were public recriminations.

Allies of Mr Salmond were quoted in the media attacking the SNP campaign.

On June 25, the party took another blow with the death of former leader Gordon Wilson.

Two days later, Ms Sturgeon told MSPs she had “reset” her referendum plan, and vowed an update in late 2018.

In August, the tensions between Ms Sturgeon and Mr Salmond continued. Notably absent from his stage show on the Edinburgh Fringe, she was forced to deny he was a sexist after he made a smutty joke about her and other female politicians on day one.

MPs elected Ian Blackford their new Westminster leader, replacing Mr Robertson.

It was not until Holyrood returned after summer recess that Ms Sturgeon got on the front foot again, setting out a series of bold policies in her programme for government and announcing a move to “progressive taxation”.

In November, Ms Sturgeon Ruth Davidson has stalled.

Voters were happy to use her party as a club to beat the SNP, but her party has slipped in the polls.

However, the First Minister also has challenges aplenty in 2018.

She has to sell her tax plans to voters as the bills hit; sell the SNP’s Growth Commission when it comes back with a new economic plan for independence; and confront the timing of another referendum in the autumn, something her party faithful may well dislike.

She also has party management problems to resolve, with many of her MSPs feeling “unloved” and finally appeared to have her fill of her predecessor’s antics.

The announcement Mr Salmond was to host a weekly TV show on the Kremlin propaganda channel RT saw her deliver an unprecedented public rebuke to her mentor.

The end of the year confirmed her break with the Salmond era, his tax-cutting vision replaced in the Draft Budget by an overhaul of income tax that is set to deliver higher bills to 1.15 million Scots next year relative to England.

As 2017 ended, Ms Sturgeon was certainly not where she anticipated at the beginning.

But she remains the pre-eminent politician in Scotland.

Ruth Davidson has stalled. Voters were happy to use her party as a club to beat the SNP, but her party has slipped in the polls.

However, the First Minister also has challenges aplenty in 2018. She has to sell her tax plans to voters as the bills hit; sell the SNP’s Growth Commission when it comes back with a new economic plan for independence; and confront the timing of another referendum in the autumn, something her party faithful may well dislike.

She also has party management problems to resolve, with many of her MSPs feeling “unloved” and ambitious newcomers furious there was no autumn reshuffle.

The SNP has also to complete its sleaze investigation into former minister Mark McDonald, with Mr Salmond reported to be keen on standing in the by-election if he quits Holyrood.

That could take the rift between the past and present first ministers to new heights. Making New Year resolutions would again be ill-advised.