Can you do a python style include inside of a javascript file for photoshop?

I am doing a bit of Photoshop scripting. The code is getting to be a bit longer than I would like to keep in a single file and there is a lot here I would like to use in other scripts. Is it possible to do a python style include to help break this up?

[QUOTE=Berryman;26545]I am doing a bit of Photoshop scripting. The code is getting to be a bit longer than I would like to keep in a single file and there is a lot here I would like to use in other scripts. Is it possible to do a python style include to help break this up?[/QUOTE]

Yup,

I think you can do something like this:

#include “ReferenceToOtherFile.jsx”;

[QUOTE=shane;26546]Yup,

I think you can do something like this:

#include “ReferenceToOtherFile.jsx”;[/QUOTE]

Thanks!

check this as well, it will give you a “require” function that is more similar to an import:


var ui = require('lib.ui');
var win = ui.MyWindow();

Include works, also a other trick is to Rename your included jsx files to jsxinc that way you can still include them but photoshop won’t add them to the scripts menu.

I do that in one of my tools https://github.com/cmcpasserby/psMaskSync/tree/master/psMaskSync