Copy link to clipboard
Copied
Hello everyone!
I remember I already saw this in some script but I can not remember which one.
I have in the dialog box with a static text that represents the path of a directory but it does not show its end once it exceeds the space limit.
Does anyone have any knowledge about this, and can you share? Thank you
Sample:
#target Photoshop
var dlg=new Window("dialog","My Dialog",[0,0,345,80]);
var btn_inputFolder = dlg.add("button", {x:25, y:25, width:80,height:25} ,"Select Folder");
var txt_Path = dlg.add("statictext", {x:115, y:28, width:250,height:25} ,"C:/Users/MyComputer/folder02/Pictures",{multiline:true});
btn_inputFolder.onClick = function() {
var inputFolder = Folder.selectDialog("Select a folder");
if(inputFolder !=null){txt_Path.text = inputFolder.fsName};
}
dlg.center();
dlg.show();
Hi mauricior6328708,
cool - good finding. It seems to work now (in newer versions)
var txt_Path = dlg.add("statictext", {x:115, y:28, width:200,height:25} ,"C:/Users/MyComputer/folder02/Pictures",{ truncate:'middle' });
Copy link to clipboard
Copied
Hi smithcgl9043167
IMHO truncate() does not work in Adobe Extendscript.
Here is a possible solution:
jquery - How to truncate a string (containg a path) without touching the filename? - Stack Overflow
Copy link to clipboard
Copied
Hi smithcgl9043167 what you want to add may be possible !.
Here's something that might help you:
if you notice this there is in the Image Provcessor.jsx script
I do not understand javascript and maybe someone can do it for you. Good luck
Copy link to clipboard
Copied
Hi mauricior6328708,
cool - good finding. It seems to work now (in newer versions)
var txt_Path = dlg.add("statictext", {x:115, y:28, width:200,height:25} ,"C:/Users/MyComputer/folder02/Pictures",{ truncate:'middle' });
Copy link to clipboard
Copied
pixxxel schubser you went very well! That was a perfect fit.
Copy link to clipboard
Copied
can also do this )
if(inputFolder !=null){txt_Path.helpTip=txt_Path.text=inputFolder.fsName};
Copy link to clipboard
Copied
Hi r-bin,
yes.
But I think he want see only
C:/Folder/v…rylongPath/Subfolder
instead of
C:/Folder/veryveryveryverylongPath/veryveryveryverylongPath/Subfolder
Copy link to clipboard
Copied
This pops up when you point the mouse at the text.
And what to do if the last folder is S1234567890uuuuuuuuuuuuuuuuuuuuuuuuuBBBBBBBBBBBBolder ?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
:))
Copy link to clipboard
Copied
Perfect! It works divinely well.
mauricior6328708 Thanks for the tip fundamentel
pixxxel schubser Thanks for the solution
r-bin thanks for adding a tooltip to this function!
Thank you all!