Skip to main content
rcraighead
Legend
February 24, 2021
Answered

.JSX vs .JSXBIN ??

  • February 24, 2021
  • 2 replies
  • 2881 views

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. 

  • Are there any advantages/reasons to make this a .jsxbin file? I am not as concerned about file protection as I am about possible speed advantages.
  • Can it be exported from VSCode since ESTK is now defunct?
This topic has been closed for replies.
Correct answer Silly-V

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.

2 replies

m1b
Community Expert
Community Expert
February 24, 2021

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.

rcraighead
Legend
February 24, 2021

I'm using ExtendScript Debugger plugin to export the jsxbin and find it is smaller than the original jsx (156 to 133KB).

Silly-V
Silly-VCorrect answer
Legend
February 24, 2021

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.

rcraighead
Legend
February 24, 2021

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.

Silly-V
Legend
February 24, 2021

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!