This version gets an error "Error 1302: no such element" in Photoshop CS5 on line 27:
var exportSettings = app.getCustomOptions(settingsID);
I think the same code is also in line 363.
I don't think Photoshop CS5 can remember previous settings, or the API changed.
UPDATE:
I used the version with the try-catch block. Seems to work fine in CS5 now. Maybe that was the problem.
@Shiu/@[deleted]/@[deleted]
By the way, do you want to put this on GitHub as a GIST?
https://gist.github.com/
So we can branch and fork and stuff and people can choose the version that works for them while we can still track changes and bugs?