Last I heard, Scotland would have to join the queue of applicants to be considered as a new EU member and no one in Brussels (definitely anti-nationalistic) wanted to encourage Scotland in this move. Spain would undoubtedly veto this given their strong stance against Catalan independence. They could be out in the cold.
https://www.theguardian.com/politics/2017/feb/10/independent...