Hi,
is there a way to reliably obtain the path of an applicaton (*.jmpapp)? My tests with "get current directory()" and "get default directory()" have not been successful.
As a woraround I created a journal of the application ("save script to journal" in the application builder). This way "get default directory()" gives the path of the journal.
But I fear that this solution is not reliable, for example if you change "Data Files directory" in Preferences.
So is there a better way to get the path of an application?
Currently there is no way to directly query the path of a running application. When deploying an app as an Add-In, what is commonly done is to use the path to the Add-In as a reference point. The Add-In folder can be found using:
"$ADDIN_HOME(id)"
The id in this case is the unique name given to the Add-In at creation time, such as com.jmp.jmpgeocoder.
Thanks.
I think I don't necessarily need an application, I probably could achieve the same with a script. Could you query the path of a running script instead?
The best way to do this is to make your .jmpapp file an addin. Then you can refer to files in the application directory using the $addin_home construct. For example suppose your addin ID is com.mycompany.dept.mygreatapp. You could reference files in that addin's location via:
include("$addin_home(com.mycompany.dept.mygreatapp)\myprogram.jsl");