The former chief executive of the Scottish National Party has appeared in court.