The former SNP chief executive appeared nervous as he was escorted into the High Court in Edinburgh from a prison van.