Skip to main content
Geppetto Luis
Legend
May 17, 2018
Answered

creates slidre opacity level change

  • May 17, 2018
  • 5 replies
  • 1165 views

Someone could be kind to create a small panel with only one slider that changes opacity to the level with the name test.

Thanks to those who help me

This topic has been closed for replies.
Correct answer Loic.Aigon

You weren't that far

Here you are

5 replies

Loic.Aigon
Loic.AigonCorrect answer
Legend
May 21, 2018

You weren't that far

Here you are

Geppetto Luis
Legend
May 22, 2018

Loic.Aigon

the link does not work

Loic.Aigon
Legend
May 22, 2018

Try again…

Loic.Aigon
Legend
May 18, 2018

Let's rewind this. What app are you targeting exactly ? Photoshop ? If so the sharpen filter has its own ui so what would be the point of adding one ?

Geppetto Luis
Legend
May 18, 2018

I should use it with photoshop cc2018

I put sharpen as a test name only

I try to use this code

the slider appears on html page but does not work

there must be an error that I can not see

code

js/main.js

// this instantiates the csInterface which allows us to communicate with the ExtendScript runtime

var csInterface = new CSInterface();

function sliderOnChange(value) {

  // here we call call the "setLayerOpacity" function on the ExtendScript side

   csInterface.evalScript("$.global.setActiveLayerOpacity(" + value + ")");

}

jsx/Photoshop.jsx

$.global.setActiveLayerOpacity = function (layerOpacity) {

  if (!app.activeDocument || app.activeDocument.activeLayer) {

    alert('Please select a layer!')

    return

  }

  app.activeDocument.activeLayer.opacity = setLayerOpacity;

}

index.html

<!doctype html>

<html>

  <head>

    <meta charset="utf-8">

    <script src="./ext.js"></script>

    <script src="./lib/CSInterface-4.0.0.js"></script>

    <link id="ppstyle" rel="stylesheet" type="text/css" href="./style.css">

    <title>Test</title>

  </head>

  <body>

    <div id="content">

      <input type="range" min="0" max="100" value="0" step="1" id="opacity" name="opacity" onChange="sliderOnChange(this.value)"/>

      <script src="./js/main.js"></script>

    </div>

  </body>

</html>

Geppetto Luis
Legend
May 18, 2018

Thanks for the compliment

the level has the name sharpen.

Loic.Aigon
Legend
May 18, 2018

60 is the new young !

Ok what is the "level" need. I am afraid I can't get the idea ?

Loic.Aigon
Legend
May 17, 2018

Yes those nice guys are called Freelancers. They will give you their best in exchange for some money covering the time they will spend helping you.

Or you could start trying on your own, learning from scratch as we have all done, and find a lot of people who will help and encourage you in your efforts.

Loic

Geppetto Luis
Legend
May 18, 2018

you are definitely right

unfortunately I have reached the age of 60 and I no longer have the ability to learn how to do these things, that's why I called for help, if someone can help me and welcome me otherwise I'm sorry and I leave it alone.

good day to all