Subscribe Bookmark RSS Feed

Central location for scripts?

miguello

Community Trekker

Joined:

Jan 27, 2016

I'd like to create central location for all scripts.

let's say I'd like to organize them as functions. And include files with functions as I write other scripts.

since I'll be working in different directories, is there any way to specify a central location, so each time I say Include(scripts.jsl) - it knows where to pick it up without writing a specific path? There is a predefined $SAMPLE_SCRIPTS variable - wher ecan I change or add to it?

Thanks!

2 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

In 'Help > Scripting Index' try searching for 'set environment' and look at the example. See also. There's a 'Get Environment Variable()' too.

pmroz

Super User

Joined:

Jun 23, 2011

I have several addins, each with their own folder.  Suppose you've defined an addin like this sample addin.def file:

id="com.cmpny.dept.myapp"

name="My Great Program"

autoload=1

home="M:\JMP\GreatApp\Addin"

This points your addin to the folder M:\JMP\GreatApp\Addin for all of the JSL files for this addin.  Then you can refer to it's location using the $ADDIN_HOME construct:

include("$ADDIN_HOME(com.cmpny.dept.myapp)\Great_Program.jsl");