Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
kabir
Level II

Referening data file distributed within an add-in

For my jsl to work, I refer to a data table. Now for distributing it, I am building an add-in (lets call it test_addin) for it and adding the data file in it under the "Additional Files" tab in the add-in builder. Once installed, the data file gets saved in the same folder as the jmp add-in file.

e.g. both data file and the jsl for the add-in are saved at the address below- C:\Users\MyUserID\AppData\Local\SAS\JMP\Addins\test_addin\

now the "MyUserID" part will be different for each user.... How would I reference it later as I will not know the users who install it?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
pmroz
Super User

Re: Referening data file distributed within an add-in

You could use the addin shortcut.  Suppose the "alias" for your addin is com.mycompany.test_addin.  Then you could simply refer to a file using $ADDIN_HOME:

"$ADDIN_HOME(com.mycompany.test_addin)\myfile.jmp";

View solution in original post

4 REPLIES 4
Highlighted
acohen
Level I

Re: Referening data file distributed within an add-in

Perhaps the Journal Packager add-in will do the trick for you. I've used it successfully for what seems like the same purpose as yours.

From the add-in description: "Sharing large journals, containing file references scattered across a labyrinthine directory structure, can be problematic.This addin allows the user to package a journal for easy sharing"

First I use Journal Packager to package the Journal and the files, then I use the instructions in this blog post on building add-ins for classes and textbooks to create the add-in.

kabir
Level II

Re: Referening data file distributed within an add-in

Thanks for the help.

Thought of a simple way that it would work for my case at least-just,  saving the file on the C drive so no user id goes into the refencing part. Absolute/ relative reference will remain the same for all users. Jsl command like get user id would be really useful as well but I don't think it exists yet. So along with the add-in, I also request the users to add this additional file on the C drive and my jsl references to it.

Highlighted
pmroz
Super User

Re: Referening data file distributed within an add-in

You could use the addin shortcut.  Suppose the "alias" for your addin is com.mycompany.test_addin.  Then you could simply refer to a file using $ADDIN_HOME:

"$ADDIN_HOME(com.mycompany.test_addin)\myfile.jmp";

View solution in original post

Highlighted
kabir
Level II

Re: Referening data file distributed within an add-in

Thanks, this works perfect!

Article Labels

    There are no labels assigned to this post.