Scotland's most senior judge will be asked how sheriffs should deal with stubborn parents who are "bringing the courts into disrepute" by flouting orders compelling them to give estranged partners access to their children.

Holyrood's Public Petitions Committee will write to the Lord President's office amid widespread agreement amongst MSPs that parents cannot continue to ignore the will of the courts without redress.

The committee heard from petitioner Alan Lee, who has faced repeated obstacles in seeing his children despite being granted access by the courts.

Former justice secretary Kenny MacAskill said he was unable to find a solution to this common problem during his long career as a lawyer and government minister that did not involve sending the recalcitrant parent to jail.

Mr Lee suggested community service may be an appropriate punishment, and Mr MacAskill said it would be appropriate to take the question "right to the top" of the judiciary.

Committee convener Michael McMahon agreed, insisting people should not be allowed to dismiss custody orders with impunity.

Mr Lee said: "I don't want to have to be forced, as a last resort, to having to climb to the roof of this parliament in a Batman suit."

Fathers who have been denied access to their children frequently pose in superhero outfits on prominent public buildings to grab media attention under the banner Fathers4Justice.

Mr Lee added: "Although the order is in place, I find that most resident parents - I hate referring to mothers because I don't want to penalise them - just ignore that order.

"I can't do anything about that. Even if I phone the police they will say that it's a civil matter and you will need to go and see your lawyer."

Mr MacAskill said he has sympathy for the parents and the sheriffs caught up in difficult custody battles.

"If a sheriff says, 'I have given a contact order, you must adhere to it', and the resident parent says no they have two options," he said.

"One is to switch the residency from mother to father or father to mother, which they may have decided is inappropriate, or they can jail them, in which case where do you put the child?"

"Is there a third way which, I have to say, over 20 years as a lawyer and 16 years in parliament I have never been able to discover?"

Mr Lee said: "I wouldn't think jailing a parent is going to solve the solution, because the child needs both parents.

"Some other punishment such as maybe community service, or time spent at a local charity shop giving up their time rather than a custodial sentence would be much more beneficial."

Mr McMahon said: "If a court order is made people should not be able to reject that with impunity. The court must have some redress.

"I wonder who would be best to contact about the enforcement of court orders to get a view from the court service."

Mr MacAskill said: "You could look to the Lord President, now that he is chair of courts and tribunals.

"A court order should be obtempered, otherwise it brings the court into disrepute.

"Equally, I have to say in my experience a lot of these issues tended to run into mental health issues which then challenged matters.

"But I think asking the very top would be appropriate here."

The committee agreed to continue the petition and write to the Lord President, the Family Law Centre and the Legal Aid Board for further evidence.