Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


UI Script EditNumber control

New Here ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

I have several sample scripts from the default installation that include the 'EditNumber' control for UI elements. Does any one have the definition of this control? I see the definition of EditText in the JavaScript UI docs but nothing on EditText

 

Thanks

Dean

 

TOPICS
Actions and scripting

Views

447

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

EditNumber was first time found on this forum on Mar, 5, 2020, but for some reason posts about are removed from this thread: How does one make a Scriptui dialog or palette resizeable?

 

Ps. could you link us to scripts that contain 'EditNumber'?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

For example Image Processor.jsx from

 

C:\Program Files\Adobe\Adobe Photoshop 2020\Presets\Scripts

 

a copy of which:

 

Image Processor.jsx

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

EditNumber was introduced some time later after EditText, and it reacts for numbers only.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 04, 2021 Jul 04, 2021

Copy link to clipboard

Copied

@Kukurykus 

 

Thanks, that is a pretty sweet option and also a short change (edittext to editnumber). I may make another version so that floats are easily input. I'll also look at adding a simple regex to strip out any decimal values, unless you can suggest another way to enforce integer input apart from using the numeric keydown event?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 04, 2021 Jul 04, 2021

Copy link to clipboard

Copied

 

+String(123.456).split(/(?:\.\d+$)/)

 

or:

 

~~123.456

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 05, 2021 Jul 05, 2021

Copy link to clipboard

Copied

LATEST

Hmmm... I would have done a replace rather than split, but the regex achieves the same end as I would have used.

 

However, the ~~ double tilde has raised my interest...

 

EDIT: Thank you, I am happy with using the "double NOT Bitwise operator" or  Math.floor() in conjunction with EditNumber!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines