Problem with pathes in SavePDF<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Dear JMP-Team,
I was wondering if there is anything that I am doing wrong because SavePDF does not seem to use my path-argument properly. This is the essential part of my code:
save path = "C:/Basti/Desktop";
graph1 = Graph Builder( ... ) << Report;
graph1 << Set Page Setup( margins( 1, 1.25, 0.25, 1 ), scale( 1.1 ), portrait( 0 ), paper size( "A4" ) );
graph1 << SavePDF( save path || "Graphs 1 and 2_" || Char( As Date( Today() ) ) || ".pdf" );
Instead of saving the pdf to the desktop it is stored in the same folder as my script. Furthermore the name of the pdf looks like this:

Thanks for any advice,
Sebastian
Re: Problem with pathes in SavePDFThanks for all of your support!
With jeff.perkinson 's example i was able to solve it. As your example worked for me as well I wondered what was different. Now it's obvious to me that it is not a good idea to include
Char(As Date(Today()))
into the file name, as this produces:
26Jan2016:08:58:38
Which is of course problematic for a file name as it is containing ":". Using Char( Format( Today(), "YYYYMMDD" ) ) works fine.
Thanks for the tips with the formated code as well! I really appreciate this community!
Sebastian
Re: Problem with pathes in SavePDFI had a problem with the formatting when I cut and paste, and it turned out to be the browser I was using. I now use IE to cut and paste. Also, I copy the script code first to MS Word, which for some reason, allows for the proper indentation of the code.
Re: Problem with pathes in SavePDFHmmm...I'm not having any difficulty.
path = "C:/Users/Jeff Perkinson/Desktop/"; dt = Open( "$SAMPLE_DATA\Big Class.jmp" );graph1 = dt << Graph Builder( Show Control Panel( 0 ), Variables( X( :height ), Y( :weight ), Overlay( :sex ) ), Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )) << Report;graph1 <<SavePDF( path ||"XYZZY"||".pdf");
I end up with "XYZZY.pdf" on my Desktop.
Perhaps you can send a note to Tech Support and see if they can help you track down what's going on.
-Jeff
Re: Problem with pathes in SavePDFHow do I get the formatted code here in the forums?
- Copy/paste the JSL code from the JSL editor to MS-Word.
- Then, copy/paste the code from MS-Word to here.
a = "The code looks like this";
Re: Problem with pathes in SavePDFHi Jeff & thanks for the reply.
Sadly the missing "/" was just a copying error on my side. The "/" is in there, but I get the results like above.
By the way: How do I get the formated code here in the forums?
Cheers,
Sebastian
Re: Problem with pathes in SavePDFYou need a "/" to separate the save path from the filename:
save path = "C:/Basti/Desktop/";graph1 = Graph Builder( ... ) << Report;graph1 << Set Page Setup( margins( 1, 1.25, 0.25, 1 ), scale( 1.1 ), portrait( 0 ), paper size( "A4" ) );graph1 <<SavePDF( save path ||"Graphs 1 and 2_"||Char(As Date(Today()))||".pdf");
-Jeff