Save UV face layout

This script doesn’t seem to be saving the layout if I choose to export only selected faces. Any idea why?