Copy link to clipboard
Copied
I want to select all text inside an edittext
I know how the edittext is determined byedittext. active=trueBut 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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 );
Copy link to clipboard
Copied
Find more inspiration, events, and resources on the new Adobe Community
Explore Now