Copy link to clipboard
Copied
I maintain a functions library in .jsx and distribute to about 5 users via OneDrive. It works fine and is about 156kb. It is loaded about once a day or when it is updated.
Hey there! I'm not sure what speed advantages there are to transferring 156kb? That seems like a small amount, once per day - but rest assured - turning it into JSXBIN will make that size bigger because out of every normal text character in your code it will make a bunch of characters that encrypt that one.
As to your 2nd point, yes with your VSCode extension comes a JSXBIN command- activate it by doing Cmd+Shift+P and type in "jsxbin" to find the command.
Copy link to clipboard
Copied
Hey there! I'm not sure what speed advantages there are to transferring 156kb? That seems like a small amount, once per day - but rest assured - turning it into JSXBIN will make that size bigger because out of every normal text character in your code it will make a bunch of characters that encrypt that one.
As to your 2nd point, yes with your VSCode extension comes a JSXBIN command- activate it by doing Cmd+Shift+P and type in "jsxbin" to find the command.
Copy link to clipboard
Copied
Thanks, @Silly-V . This was an off-shoot of you recent post. I had just tracked down how to export the jsxbin by right-clicking within the script file in VSCode (with ExtendScript Debugger installed).
The JSXBIN is 133KB vs 156KB for the JSX. I'll run it and see if I can detect any difference in speed.
EDIT:
My initial observation is it seems to work a bit faster. I'm using a tip from this YouTube post
suggesting the JSXBIN content can be pasted directly into a standard JSX for easier accessibility. It works. I'm not sure you couldn't just rename the JSXBIN file though. I send the JSX to AI through an Applescript from Keyboard Maestro so leaving as a JSX is helpful.
Followup: The jsxbin file works fine when run from Keyboard Maestro.
Copy link to clipboard
Copied
Ha, so it's smaller. I just remember putting a small string into a JSXBIN to hide a password and ended up getting with a lot longer string. Maybe it can optimize a bunch of other stuff somehow. Maybe someone can pop in to explain how it really works!
Copy link to clipboard
Copied
Yeah, and the fact I can "wrap" it in a normal JSX makes accessing it simpler.
Edit: The jsxbin works fine in Keyboard Maestro.
Copy link to clipboard
Copied
you can rename your *.jsxbin to *.jsx without issues, illustrator knows it's a jsxbin somehow.
Copy link to clipboard
Copied
Carlos, The jsxbin file starts with a plain text header, eg.
@JSXBIN@ES@2.0@MyBbyBn0AFJlVnABjzHiNjJjUjUjFjOjTBfWzGiPjCjKjFjUCiJzJ...
Copy link to clipboard
Copied
But there appears to be considerable overhead, too, not just the binary encoding bloat. In my test it turned a 110 byte jsx into 154KB jsxbin! VSCode referred to the file as 'compiled'. Is it possible that it really compiles it somehow, rather than just encodes it? That might explain the overhead, and also the minimisation at larger file sizes. Sorry I have no idea, just my thoughts.
Copy link to clipboard
Copied
In my VSCode I found it by searchng "bin" which showed "Export to binary..." which did export a .jsxbin file. Do you have a dedicated "jsxbin" command?
Copy link to clipboard
Copied
No, I just think I found it the one time I used it by entering 'jsxbin', I probably wasn't even thru typing it lol
Copy link to clipboard
Copied
I just noticed this VSCode extension TextToJSXBIN. Seems to convert to JSXBIN inline and use eval().
UPDATE: I couldn't get this to work. It gave me error: "(#12)Unable to retrieve last error information." when running in debugger. Oh well.
Copy link to clipboard
Copied
I'm using ExtendScript Debugger plugin to export the jsxbin and find it is smaller than the original jsx (156 to 133KB).