Document saved property not updating when manipulating guides
I'm working on a script which among other things removes all guides in an image file. It's meant to run as a batch script, so for speed I don't want to save an image if I didn't actually removed anything.
I'm checking the saved property of the active document, but it doesn't seem to change when removing guides (or adding them). Doing this manually in Photoshop triggers a change in the value, but not when I script it. I'm also removing color samplers via the same script, and that changes the value of the saved property as expected.
The only option right now seems to be to save all images regardless of any change, but that will slow things down a lot. Does anyone know why manipulation of guides doesn't change the saved state?
app.open( new File( 'path/to/image' ) );
var theImg = app.activeDocument;
theImg.guides.removeAll();
if ( ! theImg.saved ) {
theImg.save();
}
theImg.close();
