có bro nào giải mã được code jsx này ko nhỉ. mình giải được ra mà nó bị lỗi ký tự ko biết fix sao
cTID = function(ª) {
return app.charIDToTypeID(ª);
};
sTID = function(ª) {
return app.stringIDToTypeID(ª);
};
var EyþҙᘔܐकԎÑ = app.stringIDToTypeID("UrlOverview");
varçꀾꊀ㘔 = app.stringIDToTypeID("UrlData");
varꁽ㦰㦾PW㦶 = "GallerySettings";
varúWñÖEÝÖRIҫ = app.stringIDToTypeID("NameGallery");
try {㜌Ҭ = app.getCustomOptions(ꁽ㦰㦾PW㦶);
} catch (P) {
var㜌Ҭ = new ActionDescriptor();
app.putCustomOptions(ꁽ㦰㦾PW㦶, 㜌Ҭ, true);
}
varóҋठüÊQl = 㜌Ҭ.getString(çꀾꊀ㘔);
varçCOꁅҪ갅Җԃ = 㜌Ҭ.getString(EyþҙᘔܐकԎÑ);
varªヤꑃǥVÌÄàÕ = 㜌Ҭ.getString(úWñÖEÝÖRIҫ);
var ERұ㘌ûå = 20;
varIԎᘎAâç㭴 = 4;
var n㜔ᔘĈĐखØà = 7;
varङùûTनᔅฌȒ = IԎᘎAâç㭴 * n㜔ᔘĈĐखØà;
varञҞ㘒ꄋ = ERұ㘌ûå * ङùûTनᔅฌȒ;
varҜÝDëìÿÉçҀद = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "47", "50");
varÅæÓùwÓåDDyùMꐱᐋU = new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");
varመธ㜐간 = çCOꁅҪ갅Җԃ;
var㘏Uѽұ = óҋठüÊQl;
function㘒ҰꄐÑðYҲұ (òJǻq, rȔċĐȀ) {
for (var n = 0; n < òJǻq.length; n += 1) {
if (!(òJǻq[n] instanceof File)) {
rȔċĐȀ.push(òJǻq[n]);
}
}
}
functionธҺ㘐ሎ (iñѿ) {
varꑂ갇ąåJ = iñѿ.toString().lastIndexOf("/");
varҀtåáhñ = iñѿ.toString().substr(ꑂ갇ąåJ + 1, (iñѿ.toString().length - ꑂ갇ąåJ) - 1);
varӀ㜖 = Ҁtåáhñ.lastIndexOf(".");
varӅǨñꉚꁸ = Ҁtåáhñ.lastIndexOf("(");
varßçïiùGꄍh = Ҁtåáhñ.lastIndexOf(")");
varÌ쑫Ċᘄघ = Ҁtåáhñ.substr(ӅǨñꉚꁸ + 1, (ßçïiùGꄍh - ӅǨñꉚꁸ) - 1);
if (Ì쑫Ċᘄघ == "jpg") {
returnҀtåáhñ.substr(0, Ӏ㜖 + 1) + "jpg";
}
if (Ì쑫Ċᘄघ == "jpeg") {
returnҀtåáhñ.substr(0, Ӏ㜖 + 1) + "jpeg";
}
if (Ì쑫Ċᘄघ == "psd") {
returnҀtåáhñ.substr(0, Ӏ㜖 + 1) + "psd";
}
if (Ì쑫Ċᘄघ == "enc") {
returnҀtåáhñ.substr(0, Ӏ㜖 + 1) + "enc";
}
returnҀtåáhñ;
}
varHᐗÈFÛ = Folder(decodeURI(መธ㜐간)).getFiles();
var裡왂ꉤ㦝 = HᐗÈFÛ.length;
varȒĄҁ㜈ꄇ = [];㘒ҰꄐÑðYҲұ (HᐗÈFÛ, ȒĄҁ㜈ꄇ);
var Gꁶ욇㜇 = 0;
var욈ǧᔅkÇjC = File(decodeURI(መธ㜐간)).getFiles("*.png");
varǯǷꄏҥVÕC = 욈ǧᔅkÇjC.length;
if (ǯǷꄏҥVÕC > ञҞ㘒ꄋ) {ǯǷꄏҥVÕC = ञҞ㘒ꄋ
}
varďK燐ү㜁जꄕ = new Window("dialog");ďK燐ү㜁जꄕ.text = ªヤꑃǥVÌÄàÕ;ďK燐ү㜁जꄕ.preferredSize.width = 920;ďK燐ү㜁जꄕ.orientation = "column";ďK燐ү㜁जꄕ.alignChildren = ["center", "top"];ďK燐ү㜁जꄕ.spacing = 10;ďK燐ү㜁जꄕ.margins = 16;
varᘇÇCÅÉԄ = ďK燐ү㜁जꄕ.add("tabbedpanel", undefined, undefined, {
name: "tpanel1"
});ᘇÇCÅÉԄ.alignChildren = "fill";ᘇÇCÅÉԄ.preferredSize.width = 920;ᘇÇCÅÉԄ.margins = 0;
varञᘔᔓᐌช = 0;
var Gꁶ욇㜇 = 0;
var㜂ҁӂuÌ = 0;
varꀿꁭҘ = new Array();
varïӇºmÎØ = new Array();
varᐏᘆh왞욒 = new Array();
var㘗ऋꂀҕ = false;
var LÍ㘅ꄈªgaÍqù = 0;
var hdҍųǻ㜗ᘔܐeÒ = 0;
var IÉÌ욇㦐ǺᔍȘoº = 0;
varîsMæêJ = ȒĄҁ㜈ꄇ.length;
if (îsMæêJ > ERұ㘌ûå) {îsMæêJ = ERұ㘌ûå
}
for (var㜂ҁӂuÌ = 0;㜂ҁӂuÌ < îsMæêJ;㜂ҁӂuÌ += 1) {
varꉉ㘐ĀëÈm = File(decodeURI(ȒĄҁ㜈ꄇ [㜂ҁӂuÌ])).getFiles("*.png");
varǺǫwöÙíÌ = ꉉ㘐ĀëÈm.length;
varऔÄZä㣱 = Math.floor(ǺǫwöÙíÌ / ङùûTनᔅฌȒ);
if (Math.floor(ǺǫwöÙíÌ % ङùûTनᔅฌȒ) > 0) {औÄZä㣱 = औÄZä㣱 + 1
}㘗ऋꂀҕ = false;
for (var n = 0; n < औÄZä㣱; n += 1) {
IÉÌ욇㦐ǺᔍȘoº += 1;
if (IÉÌ욇㦐ǺᔍȘoº > ERұ㘌ûå) {
break;
}ïӇºmÎØ [IÉÌ욇㦐ǺᔍȘoº] = ᘇÇCÅÉԄ.add("tab", undefined, undefined, {
name: "tab" + IÉÌ욇㦐ǺᔍȘoº
});ïӇºmÎØ [IÉÌ욇㦐ǺᔍȘoº].text = decodeURI(Folder(ȒĄҁ㜈ꄇ [㜂ҁӂuÌ]).name);ïӇºmÎØ [IÉÌ욇㦐ǺᔍȘoº].orientation = "column";ïӇºmÎØ [IÉÌ욇㦐ǺᔍȘoº].alignChildren = ["left", "top"];ïӇºmÎØ [IÉÌ욇㦐ǺᔍȘoº].spacing = 10;ïӇºmÎØ [IÉÌ욇㦐ǺᔍȘoº].margins = 10;
for (varञᘔᔓᐌช = 0;ञᘔᔓᐌช < IԎᘎAâç㭴;ञᘔᔓᐌช += 1) {
if (㘗ऋꂀҕ == true) {
break;
}
hdҍųǻ㜗ᘔܐeÒ = (n * 4) + (㜂ҁӂuÌ * IԎᘎAâç㭴) + ञᘔᔓᐌช;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ] = ïӇºmÎØ [IÉÌ욇㦐ǺᔍȘoº].add("group", undefined, {
name: "group" + hdҍųǻ㜗ᘔܐeÒ
});ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].preferredSize.width = 900;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].orientation = "row";ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].alignChildren = ["left", "bottom"];ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].spacing = 10;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].margins = 0;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].maximumSize.height = 120;
for (var Gꁶ욇㜇 = 0; Gꁶ욇㜇 < n㜔ᔘĈĐखØà; Gꁶ욇㜇 += 1) {
LÍ㘅ꄈªgaÍqù = (n * ङùûTनᔅฌȒ) + (ञᘔᔓᐌช * n㜔ᔘĈĐखØà) + Gꁶ욇㜇;
if (LÍ㘅ꄈªgaÍqù >= ǺǫwöÙíÌ) {㘗ऋꂀҕ = true;
break;
}
try {ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù] = ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].add("image", undefined, decodeURI(ꉉ㘐ĀëÈm[LÍ㘅ꄈªgaÍqù]), {
name: Folder(ȒĄҁ㜈ꄇ [㜂ҁӂuÌ]).name + "/" + ธҺ㘐ሎ (ꉉ㘐ĀëÈm[LÍ㘅ꄈªgaÍqù])
});
} catch (P) {
alert("File hoặc đường dẫn lỗi khi ADD\n" + decodeURI(ꉉ㘐ĀëÈm[LÍ㘅ꄈªgaÍqù]));
break;
}ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].preferredSize.width = 120;ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].preferredSize.Height = 120;ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].maximumSize.width = 120;ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].maximumSize.height = 120;
}
}
}
}
ERұ㘌ûå -= IÉÌ욇㦐ǺᔍȘoº;
if (ǯǷꄏҥVÕC == 0) {
ERұ㘌ûå = 0
}
varҧछᔒᔙሕᐙᐏฑ = hdҍųǻ㜗ᘔܐeÒ;㘗ऋꂀҕ = false;
for (var㜂ҁӂuÌ = 0;㜂ҁӂuÌ < ERұ㘌ûå;㜂ҁӂuÌ += 1) {
if (㘗ऋꂀҕ == true) {
break;
}ïӇºmÎØ [㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº] = ᘇÇCÅÉԄ.add("tab", undefined, undefined, {
name: "tab" + 㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº + 1
});ïӇºmÎØ [㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº].text = ÅæÓùwÓåDDyùMꐱᐋU[㜂ҁӂuÌ];ïӇºmÎØ [㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº].orientation = "column";ïӇºmÎØ [㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº].alignChildren = ["left", "top"];ïӇºmÎØ [㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº].spacing = 10;ïӇºmÎØ [㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº].margins = 10;
for (varञᘔᔓᐌช = 0;ञᘔᔓᐌช < IԎᘎAâç㭴;ञᘔᔓᐌช += 1) {
if (㘗ऋꂀҕ == true) {
break;
}
hdҍųǻ㜗ᘔܐeÒ = (㜂ҁӂuÌ * IԎᘎAâç㭴) + ञᘔᔓᐌช + ҧछᔒᔙሕᐙᐏฑ;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ] = ïӇºmÎØ [㜂ҁӂuÌ + IÉÌ욇㦐ǺᔍȘoº].add("group", undefined, {
name: "group" + hdҍųǻ㜗ᘔܐeÒ
});ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].preferredSize.width = 900;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].orientation = "row";ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].alignChildren = ["left", "bottom"];ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].spacing = 10;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].margins = 0;ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].maximumSize.height = 120;
for (var Gꁶ욇㜇 = 0; Gꁶ욇㜇 < n㜔ᔘĈĐखØà; Gꁶ욇㜇 += 1) {
LÍ㘅ꄈªgaÍqù = (㜂ҁӂuÌ * ङùûTनᔅฌȒ) + (ञᘔᔓᐌช * n㜔ᔘĈĐखØà) + Gꁶ욇㜇;
if (LÍ㘅ꄈªgaÍqù >= ǯǷꄏҥVÕC) {㘗ऋꂀҕ = true;
break;
}
try {ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù] = ꀿꁭҘ [hdҍųǻ㜗ᘔܐeÒ].add("image", undefined, 욈ǧᔅkÇjC[LÍ㘅ꄈªgaÍqù], {
name: ธҺ㘐ሎ (욈ǧᔅkÇjC[LÍ㘅ꄈªgaÍqù])
});
} catch (P) {
alert("File hoặc đường dẫn lỗi khi ADD\n" + decodeURI(ꉉ㘐ĀëÈm[LÍ㘅ꄈªgaÍqù]));
break;
}ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].preferredSize.width = 120;ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].preferredSize.Height = 120;ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].maximumSize.width = 120;ᐏᘆh왞욒 [LÍ㘅ꄈªgaÍqù].maximumSize.height = 120;
}
}
}
if (ïӇºmÎØ.length > 0) {ᘇÇCÅÉԄ.selection = ïӇºmÎØ [0]
}
function왞ワҴÈ (ùԉሕ) {
function AҝdD(Ӆ갉TÎá, ċDä㝑㮚ऋ) {
if (Ӆ갉TÎá != undefined && !Ӆ갉TÎá) {
return;
}
varÐ㦑ǹČÅbÅ = ċDä㝑㮚ऋ ? DialogModes.ALL : DialogModes.NO;
var㨞왒 = new ActionDescriptor();㨞왒.putBoolean(sTID("dontRecord"), false);㨞왒.putBoolean(sTID("forceNotify"), true);㨞왒.putPath(cTID("null"), new File(ùԉሕ));㨞왒.putInteger(cTID("DocI"), 1377);
executeAction(cTID("Opn "), 㨞왒, Ð㦑ǹČÅbÅ);
}
AҝdD();
}
functionꁄगꑁꑟ (㜉ᐃऄDM) {
function AҝdD(Ӆ갉TÎá, ċDä㝑㮚ऋ) {
if (Ӆ갉TÎá != undefined && !Ӆ갉TÎá) {
return;
}
varÐ㦑ǹČÅbÅ = ċDä㝑㮚ऋ ? DialogModes.ALL : DialogModes.NO;
var㨞왒 = new ActionDescriptor();㨞왒.putInteger(cTID("Idnt"), 3);㨞왒.putPath(cTID("null"), new File(㜉ᐃऄDM));㨞왒.putEnumerated(cTID("FTcs"), cTID("QCSt"), sTID("QCSAverage"));
varȃĀų = new ActionDescriptor();ȃĀų.putUnitDouble(cTID("Hrzn"), cTID("#Pxl"), 0);ȃĀų.putUnitDouble(cTID("Vrtc"), cTID("#Pxl"), 0);㨞왒.putObject(cTID("Ofst"), cTID("Ofst"), ȃĀų);
executeAction(cTID("Plc "), 㨞왒, Ð㦑ǹČÅbÅ);
}
AҝdD();
}ᘇÇCÅÉԄ.addEventListener("click", qǶðöOÆDðÅÄ, false);
function qǶðöOÆDðÅÄ (P) {
if (P.target !== P.currentTarget) {
varथ갂ꉟꉉ = P.target.properties.name;
var㭭zÖ㮗 = decodeURI(㘏Uѽұ + "/" + थ갂ꉟꉉ);
var wᘎᘘᘅᐂ = 0;
var mGÅÀuAOvóP = false;
if (थ갂ꉟꉉ.substr(थ갂ꉟꉉ.length - 3, 3) == "psd") {
wᘎᘘᘅᐂ = 1
}
if (File(㭭zÖ㮗).exists) {ďK燐ү㜁जꄕ.close();
if (wᘎᘘᘅᐂ == 1) {왞ワҴÈ (㭭zÖ㮗)
} else {ꁄगꑁꑟ (㭭zÖ㮗)
}
} else {
alert("Sai đường dẫn\n" + 㭭zÖ㮗, "DATA MISSING")
}
}
P.stopPropagation();
}
varฒᘑfԌᘍ = ďK燐ү㜁जꄕ.add("button", undefined, undefined, {
name: "button1"
});ฒᘑfԌᘍ.text = "Cancel";ฒᘑfԌᘍ.onClick = function() {ďK燐ү㜁जꄕ.close();
};ďK燐ү㜁जꄕ.show();