DropdownList a Preset's folder
Hello ,i have a folder with many files ,here some presets,and i want to check this file and make the dropdownlist...
Thats works but in my list ,i see the entire path ,and i just want to see the name of each files in the list..
~/Desktop/MyPresetFolder/MyPreset_01 and i just want MyPreset_01
~/Desktop/MyPresetFolder/MyPreset_02 and i just want MyPreset_02
.......
I dont know how to do that...
if you had any ideas ??
Thank you so much everyone
TOM
here is my code:
function myScript(thisObj) {
var presetsFolder = Folder("~/Desktop/MyPresetFolder");
var arrayPresets = presetsFolder.getFiles ('*.ffx');
var PositionTypesAry = arrayPresets; // This is the dropdownlist
var LIST_DIMENSIONS = [0, 0, 220, 15];
var STATIC_TEXT_DIMENSIONS = [0, 0, 60, 15];
function myScript_buildUI(thisObj) {
var panel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "myScript", undefined);
if (panel != null) {
panel.PositionGrp = panel.add('group', undefined, 'Position group');
var PositionGrp = panel.PositionGrp;
PositionGrp.add('statictext', STATIC_TEXT_DIMENSIONS, 'Presets:');
PositionGrp.PositionList = PositionGrp.add('dropdownlist', LIST_DIMENSIONS, PositionTypesAry);
PositionGrp.PositionList.selection = 1;
var buttonGrp = panel.add('group', undefined, 'Button group');
var applyBtn = buttonGrp.add('button', undefined, 'Apply');
//applyBtn.onClick = ;
panel.layout.layout(true);
return panel;
}
}
var myPal = myScript_buildUI(thisObj);
if (myPal != null) {
if (myPal instanceof Window) {
myPal.center();
myPal.show();
}
}
}
myScript(this);