Hi SEs,
I need to write a line of JSL that does what this line is supposed to do:
open("smb://jmpsmd.na.sas.com/E/Data/etl code/JMP DataMart 3/GOBUCKS.txt")
Namely, open a file that lives on a Cary server.
The code must work on Windows, and Mac.
The code must work for people in Cary, and for remote employees. (It is assumed that the person can access these via VPN, whatever.) It is OK for the user to get prompted for credentials.
I also tried with the %20 instead of spaces, which did not work. I know this is ridiculously simple, but I am not going to discover it by chance--I've already tried 
Any ideas? As a bonus, when I run the code above, my Mac prepends the local directory to the path (Christmas Gift?), which I also do NOT want.
The path the mac wants me to use, i.e., what I get when using pickdirectory() to identify the folder, is
"/Volumes/E/Data/etl code/JMP DataMart 3/".
This is completely out of the question, as users cannot be expected to connect to the server of their own accord, prior to this code being executed.
Thanks for any suggestions!!
Cheers,
Brady
Michael Hecht provided a solution; after reading it I didn't feel so badly that I hadn't figured this out. It's below.
THANK YOU, Michael!!
-Brady
mount = Function({server}, {Default Local},
If( Host Is( Mac ),
Run Program( Executable( "/usr/bin/osascript" ),
Options( { "-e", Eval Insert( "mount volume \!"smb://^server^\!"" )}),
Read Function( "text" ));
server = Concat Items( Remove( Words( server, "/" ), 1 ), "/" );
Eval Insert( "/Volumes/^server^" );
,
Eval Insert( "\!\\!\^server^" )
)
);
users = mount( "jmpsrv01.na.sas.com/Users" );
Files In Directory( Eval Insert( "^users^/Drake" ));