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

PS Script partial binary coding - how?

Explorer ,
Jan 17, 2015 Jan 17, 2015

Copy link to clipboard

Copied

Hi,

I have a PS .jsx script which I want to finalize and give to some other users.

Since there are some variables and filepaths which depend on the user environment the users need to and shall be able to change them in the source to their personal preferences.

This bit covers the first 20 or so source lines.

After that the code is fixed and I do not want them to change it. Now I do know I can export stuff as binary as a whole but that would cause everything to be unreadable and unchangeable - not desired.

If have seen a script which did behave like what I wanted but I do not know how to do it myself.

The other thing put some scrambled stuff in between eval("..........");

And the lines in there always end with a backslash.

Any hints?

TOPICS
Actions and scripting

Views

308

Translate

Translate

Report

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
Adobe
Enthusiast ,
Jan 18, 2015 Jan 18, 2015

Copy link to clipboard

Copied

It depends a bit on how you are distributing (Addons/ZXP/JSX) and running (Scripts-menu, Flash/HTML-Panel), but have you considered

  1. Put the customizable part to a text file, deliver it with your script and read the settings from your binary.
  2. Put the customizable part to web server to be downloaded once (even Dropbox.
  3. Split your script in plaintext and binary parts and eval the plaintext

Votes

Translate

Translate

Report

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
Advocate ,
Jan 20, 2015 Jan 20, 2015

Copy link to clipboard

Copied

LATEST

Me too, I would suggest the first workaround Matias mentioned.

In case you want to keep everything simple on one file only, just cut the first X lines (do not save), export as binary, open the binary file, wrap everything with eval(""); add backslashes on carriage returns and then eventually paste back the X lines on top.

You'll end up with something like:

var a = "ABCD",

   b = "_1975";

// =================================

// = Do not modify the lines below =

// =================================

eval("@JSXBIN@ES@2.0@MyBbyBn0ALJCnASzGiNiPiEiViMiFByBneHiQiTiVjUjJjMjTffJEnAUzCjcjcCEX\

zOjIjBjTiPjXjOiQjSjPjQjFjSjUjZDfXzGjHjMjPjCjBjMEfjzBhEFfRBVBfyBffENyBnAMEbyBn0A\

...

2jRCn0ABJ2jRCnAFeGjDjBjOjDjFjMAGjN40BiAjC4B0AiAB4C0AiA2hOB4D0AiAjB4E0AiA2hPB4F0\

AiAAGAGByB");

Mind you, if you happen do distribute that on Adobe Add-ons as a part of an extension, the fact you let users modify a deployed file would cause the signing/timestamping check to fail -> as a result the panel will display as blank.

Regards

Davide Barranca

---

www.davidebarranca.com

www.cs-extensions.com

Votes

Translate

Translate

Report

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