Copy link to clipboard
Copied
The slider control can be updated, when it has focus, by pressing LEFT ARROW or RIGHT ARROW keys.
But when I do, no onChanging() events are fired. Nor is the onChange() event when I hit TAB to move on to another control.
This seems to be an accessibility issue.
var w = new Window("dialog"),
slider = w.add("slider {minvalue:0, maxvalue:100, value:50, preferredSize:[500,-1] }");
slider.onChanging = function () { w.text = this.value }
slider.addEventListener('keyup', function () { slider.onChanging() })
w.show();
Copy link to clipboard
Copied
Hi @KlausKi,
Coding Corner is probably not the best place to get a response to this question. In order to move your question to the appropriate place, I need to know:
From the question, without much context, I'm guessing it's a CEP panel. Keyboard shortcuts for those only work with the panel is in focus, unless you add in some C++ elements.
Copy link to clipboard
Copied
Thanks, @Erin F., for taking the time!
I'm actually using the Photoshop "Image Processor" script ("C:\Program Files\Adobe\Adobe Photoshop 2022\Presets\Scripts\Image Processor.jsx") as a base for my own script. The code therein is pretty much my code, too.
I'm not sure about which SDK the slider is residing in. I guessed it is a core SDK component?
Copy link to clipboard
Copied
Ah-hah!
In that case, the Photoshop forum's Scripting tag will be the best place to get a response. I've moved your post and added the tags.
Copy link to clipboard
Copied
var w = new Window("dialog"),
slider = w.add("slider {minvalue:0, maxvalue:100, value:50, preferredSize:[500,-1] }");
slider.onChanging = function () { w.text = this.value }
slider.addEventListener('keyup', function () { slider.onChanging() })
w.show();
Copy link to clipboard
Copied
Great Idea!
Just a minor flaw: The text doesn't get updated before relasing the key:
So, I used "keydown" instead of "keyup" event:
slider.addEventListener('keyup', function () { slider.onChanging() })
… resulting in:
However, I suggest this line to become intrinsic to the Slider control itself, for it to behave like this regardless of whether an ExtendScript programmer may have missed to implement it himself.
Copy link to clipboard
Copied
However, I suggest this line to become intrinsic to the Slider control itself, for it to behave like this regardless of whether an ExtendScript programmer may have missed to implement it himself.
It's unlikely this will get get fixed; ExtendScript is being slowly phased out in favor of modern JavaScript UXP APIs (over several years). UXP scripting capability is coming to Photoshop this year.
Copy link to clipboard
Copied
That is, it will be possible to write not plugins, but separate scripts? (this is what most ordinary users count on, since the tasks of commercial development and daily automation often differ).
Copy link to clipboard
Copied
ExtendScript is being slowly phased out in favor of modern JavaScript UXP APIs.
By @Erin F.
That's excellent news!! Actually, that's what I was going to suggest, not being aware of the fact the UXP already existed.
My thought was the everything is at the ready already:
So it should be easy (yet loads of work still) to create a NodeJS library binding based on COM on Windows for a start.
So, with UXP we can create a NodeJS project, require the appropriate Adobe library and then use all the tools there already are on the market for development for automating Adobe products? Did I get that right from this page?
Copy link to clipboard
Copied
So, with UXP we can create a NodeJS project, require the appropriate Adobe library and then use all the tools there already are on the market for development for automating Adobe products? Did I get that right from this page?
Oh no, did you find that page by googling UXP? Was that the top result? (Do you happen to remember your search terms? That's old documentation from an Alpha release. My team will have to update the header to let people know...
The UXP latest documentation is here: https://developer.adobe.com/photoshop/uxp/2022/
You can discuss UXP in this special developer forum here: https://forums.creativeclouddeveloper.com/
Copy link to clipboard
Copied
I may have found the resulting page on page #2, googling for "Adobe UXP". I guess I found the title "Photoshop JS API · Photoshop UXP (Alpha)" more inviting than "Documentation-UXP for Adobe Photoshop". – I think I believed the other document was about some "Documentation-UXP" rather than "UXP for Adobe Photoshop" ☺
Copy link to clipboard
Copied
Thanks for pointing me to the updated location and to the forum!
I created a corresponding topic up there:
https://forums.creativeclouddeveloper.com/t/proposal-create-nodejs-binding/4447
Copy link to clipboard
Copied
keydown and keyup work same in ESTK and CS6, without delay. So is it Ps CC bug?