Just to be clear, Catalonia and Scotland will always be part of the EU. Great analysis by Xosé Antón Pérez-Lema (lawyer) published in Crónica3.com (A Mariña lucense, Lugo, Galiza):
7. At this point we need to consider the timing and procedure for such Treaty changes. Scotland’s EU membership would need to be in place simultaneously with Scottish independence. For practical and political reasons the idea of Scotland leaving the EU, and subsequently applying to join it, is not feasible. From the practical point of view, it would require complicated temporary arrangements for a new relationship between the EU (including the rest of the UK) and Scotland (outside the EU) including the possibility of controls at the frontier with England. Neither the EU (including the rest of the UK.) nor Scotland would have an interest in creating such an anomaly.
8. From the political point of view, Scotland has been in the EU for 40 years; and its people have acquired rights as European citizens. If they wish to remain in the EU, they could hardly be asked to leave and then reapply for membership in the same way as the people of a non-member country such as Turkey. The point can be illustrated by considering another example: if a break-up of Belgium were agreed between Wallonia and Flanders, it is inconceivable that other EU members would require 11 million people to leave the EU and then reapply for membership.