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

Select all text within the edittext

Enthusiast ,
Feb 09, 2023 Feb 09, 2023

 

 

I want to select all text inside an edittext
I know how the edittext is determined by
edittext. active=true
But I don't know how to select all the text inside the edittext I searched a lot and couldn't find an idea
I hope to help

 

 

MohamedHameed_0-1675942200195.png

 
TOPICS
Actions and scripting , SDK
647
Translate
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 ,
Feb 09, 2023 Feb 09, 2023

Why do you need to select the text itself? You can use edittext.text to work with whats in the box. But edittext.textselection is the selected part.

Screenshot 2023-02-09 102514.png

Translate
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
Enthusiast ,
Feb 09, 2023 Feb 09, 2023

@Lumigraphics 

Thanks for your interest bro
I want to select all the text inside the edittext because I work on a large number of data that I enter manually, and every time I want to delete the old text and insert the new text
Farid automatically, when opening the Dialogue and activating the edittext, selects the entire text in order for me to write directly without resorting to selecting the old text and writing

Was the idea explained?

Translate
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
People's Champ ,
Feb 09, 2023 Feb 09, 2023

Here is the code that works in CS6. The dialog is shown with highlighted text.

 

 

var d = new Window("dialog");

d.t = d.add("edittext", undefined, "123");

d.b = d.add("button", undefined, "OK");

d.t.onActivate = function()
    {
    this.active = false;
    this.active = true;
    }

d.t.active = true;

d.show();

 

 

In other versions I can not check. Adobe is constantly changing how it works and event handling for edittext especially. There is no version of Photoshop where edittext worked the same as in other versions.

 

Translate
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
Enthusiast ,
Feb 09, 2023 Feb 09, 2023

Well, I tried the code, but it didn't work for me either
Is this because I'm working on a Photoshop version
CS5

But thanks for the interest and help

I came up with an idea or solution from my point of view that might help me a lot

I want a function to use F commands
Such as (F1, F2, F3, F4,.....) and employing them
So that when you press, for example, F2, it activates the edittext and scans it

I know that the content of the text can be deleted from the beginning, but sometimes I need the same text entered again, so it cannot be deleted unless necessary

I know this may be trivial to you, but for me a lot more work is being done with these steps than running with the mouse to delete text every time I use this window.


I searched a lot for the procedures for using the buttons, but I only found this

And when writing F2, for example, I did not find work for this modification

It only works on recent versions
But the CS5 version is not working

function handle_key (event) {
if(event.keyName == 'F2'){
      HWT.text = ""
      event.preventDefault();
   }
HWT.addEventListener ("keydown", handle_key );

 

Translate
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
People's Champ ,
Feb 09, 2023 Feb 09, 2023
LATEST
To select the entire text in the active edittext, just press Ctrl+A.
 
Translate
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