• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

688

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
LEGEND ,
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'?

Votes

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

 

 

Votes

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
LEGEND ,
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.

Votes

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
Community Expert ,
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?

Votes

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
LEGEND ,
Jul 04, 2021 Jul 04, 2021

Copy link to clipboard

Copied

 

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

 

or:

 

~~123.456

 

Votes

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
Community Expert ,
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!

Votes

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