if you manually select a file for export, note the dialog and the 'paths' needed.
Of COURSE script 1 doesn't work.
Line 3 should be
Export Records[ $filename; Windows(ANSI)]
Also - Line 1 appears to have absolutely no purpose.
Beverly's advice is good and thorough. If you're just wanting to say export this to say your desktop or documents, this works in both Windows and Mac OS X environments.
$Path = Get ( DesktopPath ) & "file.csv"
$Path = Get ( DocumentsPath ) & "file.csv"
If you do it manually. You have not take into account operating system behavior such as forward or backwards slashes, etc. See Beverly's link for all of that.
I try to allow for the possibility that the user might be using either a Mac or a Windows machine. The note embedded in the sample script below is my reminder to myself of how it works. The script originally had a final custom dialog saying "Export Complete. You may open your exported file now.", but that became superfluous once I checked the "Open file upon completion" option in the Export dialog. I think the beeps are still helpful, tho (except they don't work under Windows).
BTW, if the abbreviation "GTY" seems odd, it's because my client's corporate name is gThankYou, an issuer of gift certificates for holidays like Thanksgiving and Christmas.
Thanks for the replies to all. I am looking for a solution that allows user to specify the Export Path, and not just only two options would be possible as Desktop or Document.