You would replace Get ( DesktopPath ) with the path to the folder where you want to store your PDF's.
You also do not have to use Get (SystemPlatform) with a different file path for each system. You can use:
"file:" & /*put your file path here */ & MyFile::PDFName & ".pdf"
as the value for the path variable on both platforms.
In windows, you can right click your folder and select properties to see and copy the path you need to use in your calculation. I think you can use Get Info on macs to do the same thing.
I use a table to hold pathnames which I can acquire as PhilModJunk pointed out.
Then my script finds the record using another field as an identifier.
Then it is a simple matter of use set variable $_filename to table::pathname & pdffilename
The value here is that the pathname can be changed at any time without having to modify a hardwired pathname in a script.
In my local file backup script I use this idea but for the backup I loop through multiple records saving a copy in 3 or 4 different folders when I close the file or anytime I activate the script.
So using a similar idea you could save the pdf to your designated folder(s).
Thanks for the suggestions and support.
In the end, I used a Let function in my variable with the path to the folder and naming parameters included. I only use this on my Mac so this simple script did the trick.
mainpath = "/drive/Users/me/Documents/business/" ;
name = INVOICES::invoiceNumber &" " & Clients table::CoCode ;
extension = ".pdf" ] ;
mainpath & name & extension )