Answered
Read return values xmlPanelFromString dialog...
(function () {
var profiles = ['co2', 'miguel', 'luis', 'pedro'];
var profileXML = [];
profileXML.push("<dialog title='Seleccionar Perfiles' buttons='accept,cancel'>");
profileXML.push(" <vbox>");
profileXML.push(" <label value='Selecciona los perfiles a importar:'/>");
for (var i = 0; i < profiles.length; i++) {
profileXML.push(" <checkbox id='profile_" + i + "' label='" + profiles[i] + "' checked='false'/>");
}
profileXML.push(" </vbox>");
profileXML.push("</dialog>");
var dialog = fl.xmlPanelFromString(profileXML.join(""));
var selectedProfiles = [];
if (dialog.dismiss === "accept") {
for (var i = 0; i < profiles.length; i++) {
var value = fl.xmlui.get("profile_" + i);
debugLog("Perfil disponible: profile_" + i + " = " + value);
if (value === "true") {
selectedProfiles.push(profiles[i]);
}
}
debugLog("Perfiles seleccionados: " + selectedProfiles.join(", "));
} else {
debugLog("Usuario canceló la selección.");
}
function debugLog(message) {
fl.trace("[DEBUG] " + message);
}
})();Dear all,
I would like to read the values of the form in a Command in Adobe Aniamte 2024 24.0.9 Build 74.
The array will be dynamic, reading data from json... At the end I would like to select between diffrent options... Instead of prompt (is working) I would like to improve the pop-ups with checkbox, radio buttons, dropdown list... This code is a small example, but I always read undefined.
The array will be dynamic, reading data from json... At the end I would like to select between diffrent options... Instead of prompt (is working) I would like to improve the pop-ups with checkbox, radio buttons, dropdown list... This code is a small example, but I always read undefined.
