Choose Language Hide Translation Bar
Highlighted
ih
ih
Level VII

Variable name for maps folder

Can JMP output the maps folder location for the current instance of JMP or, ideally, for all installed versions of JMP?  I would like to copy maps into this folder using an add-in. Perhaps something like $Desktop or $Sample_Data?

 

Convert File Path( "$Sample_Data" )
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted

Re: Variable name for maps folder

You can use the '$JMP_HOME' directory as a starting point and add '/Maps' to point to the Maps directory.

Convert File Path( "$JMP_HOME/Maps" );

EDIT:  The above code gives you the right path on Windows, but not on Mac. Below is a script that sets a "MAP_HOME" path variable, based on the current operating system.

Set Path Variable(
	"MAP_HOME",
	If( Host is( "Windows" ),
		Convert File Path( "$JMP_HOME\Maps", "Windows" ),
		Convert File Path( "$ALL_HOME\Maps" )
	)
);

 

Justin

View solution in original post

Highlighted

Re: Variable name for maps folder

 From Example of Creating a Map in Graph Builder:

JMP looks for these files in two locations. One location is shared by all users on a machine. This location is:
Windows: C:\Program Files\SAS\JMP\<Version Number>\Maps
Mac: /Library/Application Support/JMP/<Version Number>/Maps
The other location is specific for an individual user:
On Windows: C:\Users\<user name>\AppData\Roaming\SAS\JMP\Maps
On Mac: /Users/<user name>/Library/Application Support/JMP/Maps


You can't change these locations, but you might have better luck writing to the users AppData/Application Support folder since you may not have permissions for the other folder.

You can use the 'USER_APPDATA' path variable as a starting point and add '/Maps' to point to this directory (works on both Mac and Windows).

Set Path Variable( "USER_MAP_HOME", Convert File Path( "$USER_APPDATA/Maps" ) );
Justin

View solution in original post

6 REPLIES 6
Highlighted

Re: Variable name for maps folder

You can use the '$JMP_HOME' directory as a starting point and add '/Maps' to point to the Maps directory.

Convert File Path( "$JMP_HOME/Maps" );

EDIT:  The above code gives you the right path on Windows, but not on Mac. Below is a script that sets a "MAP_HOME" path variable, based on the current operating system.

Set Path Variable(
	"MAP_HOME",
	If( Host is( "Windows" ),
		Convert File Path( "$JMP_HOME\Maps", "Windows" ),
		Convert File Path( "$ALL_HOME\Maps" )
	)
);

 

Justin

View solution in original post

Highlighted
ih
ih
Level VII

Re: Variable name for maps folder

Thanks Justin,

 

There is no way for someone to change this folder, is there?  I guess that was my biggest concern but maybe that is a moot point.

Highlighted

Re: Variable name for maps folder

 From Example of Creating a Map in Graph Builder:

JMP looks for these files in two locations. One location is shared by all users on a machine. This location is:
Windows: C:\Program Files\SAS\JMP\<Version Number>\Maps
Mac: /Library/Application Support/JMP/<Version Number>/Maps
The other location is specific for an individual user:
On Windows: C:\Users\<user name>\AppData\Roaming\SAS\JMP\Maps
On Mac: /Users/<user name>/Library/Application Support/JMP/Maps


You can't change these locations, but you might have better luck writing to the users AppData/Application Support folder since you may not have permissions for the other folder.

You can use the 'USER_APPDATA' path variable as a starting point and add '/Maps' to point to this directory (works on both Mac and Windows).

Set Path Variable( "USER_MAP_HOME", Convert File Path( "$USER_APPDATA/Maps" ) );
Justin

View solution in original post

Highlighted
ih
ih
Level VII

Re: Variable name for maps folder

Thanks for the reference, I missed that one. The path variable $USER_APPDATA includes JMP, JMPPro, or JMPEA and the version number, and I do not see one in the scripting guide that takes you straight to the JMP folder.  On windows this seems to work though:

 

Regex( Convert File Path( "$USER_APPDATA" ), "^(.*/)[^/]+/[^/]+/$", "\1") || "JMP/Maps/"

Thanks again!

 

Edited to include start and end anchors in the regex match string.

Highlighted

Re: Variable name for maps folder

Sorry, accidentally left off part of the information from the doc:

Note: On Windows, in JMP Pro, the “JMP” folder is named “JMPPro”. In JMP Shrinkwrap, the “JMP” folder is named “JMPSW”.

I think this means that the Maps folder should be within the 'USER_APPDATA' folder, not just the 'JMP' folder, like where you would put add-ins. I am no expert on the map files though, maybe someone else can chime in on the accuracy of this.

Justin
Highlighted
ih
ih
Level VII

Re: Variable name for maps folder

My observations:

 

  1. If inside the version number folder Maps are not loaded (.../Roaming/SAS/JMPPro/13/Maps does not work)
  2. If in the JMP folder, both JMPPro and JMPEA pick them up (.../Roaming/SAS/JMP/Maps loads for 13Pro and 14EA)
  3. If in the JMPPro or JMPEA folders, only that software finds the maps (.../Roaming/SAS/JMPPro/Maps loads for 13Pro but not 14EA)