- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Referening data file distributed within an add-in
Thanks, this works perfect!