Skip to main content
Inspiring
November 17, 2016
Question

Best place for JSX files shared across multiple products

  • November 17, 2016
  • 3 replies
  • 2824 views

Hi all, I was wondering what's the best option for shared tools over multiple Adobe products?

Example:  I have a polyfill script which extends extendscript built in objects that I'd like automatically loaded in Photoshop, Illustrator, Premiere and After Effects before any panel code is executed.

1. Make a silent panel which registers a bunch of functions, classes etc on startup.  If so how can I determine panel load order?

2. Put a jsx file somewhere in C:\Program Files (x86)\Common Files\Adobe

3. C:\Program Files\Common Files\Adobe\Startup Scripts CC.  Still working out if this is an option...

4. ?

Thanks!

Geordie

This topic has been closed for replies.

3 replies

Inspiring
November 17, 2016

Thanks guys, yeah I use a lot of includes but was wondering if there was an official way as I'd like to avoid executing the shared scripts every time something references it, but I can minimize that with some logic.

I found this in the Photoshop CC Scripting Guide:

"On startup, Photoshop executes all .jsx files that it finds in the startup folders.

➤ On Windows, the startup folder for user-defined scripts is: C:\Program Files\Common Files\Adobe\Startup Scripts CC\Adobe Photoshop

➤ On Mac OS, the startup folder for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CC/Adobe Photoshop

If your script is in this main startup folder, it is also executed by all other Adobe Creative Suite 6 applications at startup."

I just tried adding a file here:

C:\Program Files\Common Files\Adobe\Startup Scripts CC\

But it didn't seem to be executed by Photoshop or Premiere.

Inspiring
November 18, 2016

I think I'll set an environment variable in the install process with script paths and use $.getenv to access it

JJMack
Community Expert
Community Expert
November 17, 2016

I only use Photoshop but I have many versions of Photoshop installed. All versions of Photoshop  use the same copy of the scripts I add to Photoshop.    I Install Scripts I add into a Photoshop Scripts tree on my C: drive and I link all Photoshop versions installed Presets\Scripts\ folder to my Photoshop scripts tree.   I use sub folders just to help me remember what is what.   When Photoshop starts up it scan the full tree and scripts are listed in menu File>Scripts and my Plug-in scripts are listed in menu File>Automate like the should be.

JJMack
JavierAroche
Inspiring
November 17, 2016

Hey geordiem74078114​, You can place your JSX file in your Adobe Scripts folder. You can actually put it wherever you want, but this is a folder that is created when you install an Adobe product (it might just be photoshop?).

~/Documents/Adobe Scripts/

You can then include that file in any script that you're building by adding this line at the beginning of your code

#include "~/Documents/Adobe Scripts/script.jsx"

#include is similar to a require in JavaScript. After you include your file, you will be able to use its functions.

Hope that helps.