A senior official in the Scottish Government said she “came to expect” being inappropriately touched and receiving unwanted “sloppy” kisses from Alex Salmond.
The former first minister of Scotland is on trial at the High Court in Edinburgh over accusations of sexual assault.
The prosecution witness, known as Woman A, claims the 65-year-old sexually assaulted her in Glasgow between June and July 2008.
One charge alleges he kissed her on the mouth and touched her buttocks and breast over her clothing on several occasions in Glasgow between June and July 2008.
She told the court she did not want such contact with him but did not know what would happen to her if she told the “most powerful man in the country” to stop.
Appearing behind a grey screen, she said: “I came to expect something like that to happen during my days with him during that time.
“There was no need to be that physically close. There was no need to move his hand.
“There was no need for that to happen without him meaning to do it.”
She added: “At times he would move his hand on my back and move his hands so they were on the side of my chest or they were on my back.”
The alleged incidents regarding touching were said to have happened up to five times.
Jurors were told Salmond would put pressure on her shoulders so she could not move her lips away from being kissed when being greeted, said to have happened about 10 times.
She described the incidents as “very sloppy, very unpleasant”.
It was heard Woman A began to carry a bag to put some distance between her and Salmond and he would not behave in such a manner when others were “loitering”.
Alex Prentice QC, for the Crown, asked her why she did not tell the former first minister to stop.
She said: “I liked my job, I wanted to do my job well. I didn’t know him very well. He was the most powerful man in the country.
“I didn’t know what would happen – I had experienced some volatile mood swings from him.
“It was almost easier to move away than risk antagonising him.”
Earlier, a guest at Bute House said a former Scottish Government official was at a dinner there on the evening Salmond is alleged to have tried to rape her.
The woman, who cannot be named for legal reasons, has spoken about two alleged incidents, including one charge that the 65-year-old tried to rape her in June 2014.
Salmond’s lawyer had previously suggested she had not been at the dinner that night.
But a recording of a Police Scotland interview taken via Skype in 2019 was played in the courtroom on Wednesday when the guest claimed he had met the complainer at the dinner.
The interview was carried out as part of Operation Diem, which looked into allegations against the former first minister.
Giving evidence on the third day of the trial, the woman also denied she had a consensual sexual encounter with Salmond.
Shelagh McCall QC, representing Salmond, claimed on Wednesday the prosecution witness had a consensual sexual encounter with Salmond at Bute House in August 2013.
But giving evidence on the third day of the trial, the woman said: “I have never been a willing participant of Alex Salmond’s advances towards me.”
Ms McCall said the encounter had ended when the woman said to Salmond that she had not “meant this to happen” and they realised they had got “carried away” and it was a mistake.
She added: “I am putting to you that’s exactly what you said at that point.
“The two of you sat up, put your clothes back on, realised it was a mistake.”
But the woman said: “Absolutely not, it sounds a much better ending of an evening than what actually happened.”
One attempted rape
11 sexual assaults
Two indecent assaults
Ms McCall said the woman had been “embarrassed and upset” but Salmond had told her not to worry about it and she had gone home.
The woman said this was not true.
One witness who worked with Woman H claimed he had never heard her mention the guest, while a businessman who said he attended several dinners at Bute House described her relationship with the former first minister as “friendly and comfortable”.
Salmond faces 14 charges of alleged offences against 10 women, all of which he has pleaded not guilty to.
The charges span a period between June 2008 and November 2014, with one sexual assault said to have taken place in the month of the Scottish independence referendum in September 2014.
The trial, before judge Lady Dorrian, continues.