A court in Edinburgh heard how the Scottish Government's decision was a ‘direct consequence’ of the Westminster move.