Making the script backward compatible with CS2 is really frustrating... :/ Active layer opacity is set to 100%.
Code: Select all$.writeln(app.activeDocument.activeLayer.opacity)
// 100
app.activeDocument.activeLayer.opacity=app.activeDocument.activeLayer.opacity
// Throws an error: Specified value greater than maximum allowed value
$.writeln(app.activeDocument.activeLayer.opacity==100)
// false (?!)
$.writeln(app.activeDocument.activeLayer.opacity==100.00000000000001)
// true (?!!)
$.writeln(app.activeDocument.activeLayer.opacity-.00000000000001)
// 100 (still)
app.activeDocument.activeLayer.opacity=app.activeDocument.activeLayer.opacity-.00000000000001;
// OK
// so the final solution when reading layer opacity...
var op = Math.min(app.activeDocument.activeLayer.opacity,100);
// it is faster than if and ?:
[CS2] layer.opacity 100% bug
[CS2] layer.opacity 100% bug
I documented this one somewhere before. This was one of the more painful PS bugs I've come across.
[CS2] layer.opacity 100% bug
xbytor wrote:I documented this one somewhere before. This was one of the more painful PS bugs I've come across.
I've done quick forum search for 'cs2 opacity 100%' but found nothing
I've done quick forum search for 'cs2 opacity 100%' but found nothing
[CS2] layer.opacity 100% bug
Here ya go:
http://ps-scripts.com/bb/viewtopic.php? ... pacity+100? ... pacity+100
http://ps-scripts.com/bb/viewtopic.php? ... pacity+100? ... pacity+100