Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I encrypt only a portion of the code?

Guide ,
Sep 18, 2025 Sep 18, 2025

During the conversion to jsxbin, I discovered that full encryption renders the code unusable.
Additionally, certain sections need to remain unencrypted to allow user customization.


How can I selectively encrypt specific parts of the code?

TOPICS
How to , Scripting
160
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2025 Sep 18, 2025

You can include the encrypted code into your unencrypted code. I suppose you will have to place the encrypted code in doScript. I recall doing something like this but not exactly sure how I did it and why. I will post when I find my code

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2025 Sep 18, 2025

Probably it is eval instead of doScript and also removing the new lines. See the following

https://community.adobe.com/t5/illustrator-discussions/why-cannot-i-not-run-this-jsxbin/td-p/1542141...

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 18, 2025 Sep 18, 2025

I tried it, but it didn't turn out as great as I hoped.
No response.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2025 Sep 18, 2025

What problem did you face?

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 19, 2025 Sep 19, 2025
LATEST

What does it look like?

Does it break anywhere?
Also, I've always felt that eval support isn't that great. My jsxbin was generated by right-clicking in VS Code and exporting it as a jsxbin file.

 

Like this?

var wn = [loLayerStm, moreIfoStn];
for (var i = 0; i < wn.length; i++) {
    w = newParGroStyle(app.activeDocument, magGroParStn, wn[i])
};
function main() {
    if (0 === app.documents.length)
        return alert('Please open a document and try again.');
    var doc = app.activeDocument,
        items = doc.selection;
    if (0 === items.length)
        return alert('Please select an image frame.');
}
main();

//@target indesign
#target indesign
app.preferences.setBooleanPreference("ShowExternalJSXWarning", true);
eval("@JSXBIN@ES@2.0@"@JSXBIN@ES@2.0@MyBbyBnAJMEbyBn0AJJFnASzEjGjJjMjFBAEjzEiGjJjMjFCfRBVzLjYjNjMiGjJjMjFiQjBjUjIDfJftnftOGbyGn0ABZGnAVzIjEjFjGjBjVjMjUjTEfLAhzBhBFXzGjFjYjJjTjUjTGfVBfAnJHnAEXzEjPjQjFjOHfVBfARBFeBjSff")

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines