Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Scripting Layer Opacity change

$
0
0

Hello!

 

I want to create a script that decreases current layer opacity by 5. Here's what I have now:

app.activeDocument.activeLayer.opacity -= 5;

 

The problem is, when I map the script to a hotkey and press it multiple times (e.g. to set opacity to 50%), it goes normal from 100 to 95, from 95 to 90 and so on until 75%. From that point, it goes to 69% (should be 70%). Then it proceeds as it should (69 -> 64, 64 -> 59).

It also breaks at 24% (24 -> 18), if that matters.

 

I use Adobe Photoshop CS6 on Windows 8.1 (x64).

 

Why is this happening (decrease by 6 when I have 5 in my code)? Am I doing something wrong? Sorry if this question is stupid, I am just new to Photoshop scripting...


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>