JMP provides the following functions to determine whether a file or directory is writable before attempting to write to them. Use these functions in combination with Is Directory(path) and Is File(path) to verify a script destination and attribute. See Is Directory(path) and Is File(path) in the JSL Syntax Reference book for additional information.
The Is Directory Writable(path) function returns 1 if the directory specified in the path argument is writable and 0 otherwise.
The Is File Writable(path) function returns 1 if the file specified in the path argument is writable and 0 otherwise.
If( Is Directory( "$SAMPLE_DATA/Loss Function Templates" ),
	If( Is Directory Writable( "$SAMPLE_DATA/Loss Function Templates" ),
		"Directory is writable.",
		"Directory is read only!"
	),
	"Is a read only directory."
);

Help created on 7/12/2018