FM 8.03 Windows get(documentsPath), Send Mail Attach problem

FM 8.03 Windows get(documentsPath), Send Mail Attach problem

am 02.11.2007 16:36:25 von Paul Bruneau

I have solved this, but I couldn't find any reports of the problem
anywhere so I post this message to help others and to see if anyone
else found it.

I am starting to do some saving of records to PDF then sending the
resulting file out as an email attachment.

On Mac, of course, everything is fabulous.

But for a windows user the file would be created in the desired
directory just fine, but would not attach to the email in the Send
Mail step.

First I would save files to pdf using a $variable with the path
constructed as follows:
Get ( DocumentsPath ) & "attachments/Invoice #" & InvItems::InvoiceID
& ".pdf"
This step worked fine. File was created in the directory

But the mail message would come up without the file attached.

With some experimentation I found that the supplied path was:
/C:/Documents and Settings....

As I said, this worked fine for CREATING the file.

But for Send Mail to tell Outlook Express to properly attach the file,
I had to put "filewin:" in front of that path! FM gave me a path that
wouldn't work in Send Mail, what gives?

And by the way, what is filewin: for anyway?!?! Shouldn't
DocumentsPath supply a full usable path on whatever platform?!? I
wasn't thrilled about putting a platform test in my otherwise perfect
script :)

Re: FM 8.03 Windows get(documentsPath), Send Mail Attach problem

am 02.11.2007 18:10:35 von KevinSmith

Hi Paul

I had the same problem. I was exporting invoices to a *.csv file. I
used the Get (DesktopPath) function to save to the desktop. For the
export function within FileMaker I found it necessary to put the
"filewin" prefix. On the Mac, I had to put in at slash, before the
filename, but not on the PC.

If (

//Macintosh path format
Abs (Get ( SystemPlatform )) =1;
Get ( DesktopPath ) &
"\"" &
$FileName
;

//PC path format
"filewin:" &
Get ( DesktopPath )
&
$FileName
)

Regards
Kevin Smith


On Nov 2, 3:36 pm, Paul Bruneau wrote:
> I have solved this, but I couldn't find any reports of the problem
> anywhere so I post this message to help others and to see if anyone
> else found it.
>
> I am starting to do some saving of records to PDF then sending the
> resulting file out as an email attachment.
>
> On Mac, of course, everything is fabulous.
>
> But for a windows user the file would be created in the desired
> directory just fine, but would not attach to the email in the Send
> Mail step.
>
> First I would save files to pdf using a $variable with the path
> constructed as follows:
> Get ( DocumentsPath ) & "attachments/Invoice #" & InvItems::InvoiceID
> & ".pdf"
> This step worked fine. File was created in the directory
>
> But the mail message would come up without the file attached.
>
> With some experimentation I found that the supplied path was:
> /C:/Documents and Settings....
>
> As I said, this worked fine for CREATING the file.
>
> But for Send Mail to tell Outlook Express to properly attach the file,
> I had to put "filewin:" in front of that path! FM gave me a path that
> wouldn't work in Send Mail, what gives?
>
> And by the way, what is filewin: for anyway?!?! Shouldn't
> DocumentsPath supply a full usable path on whatever platform?!? I
> wasn't thrilled about putting a platform test in my otherwise perfect
> script :)

Re: FM 8.03 Windows get(documentsPath), Send Mail Attach problem

am 02.11.2007 23:12:40 von Paul Bruneau

On Nov 2, 1:10 pm, KevinSmith
wrote:
> Hi Paul
>
> I had the same problem. I was exporting invoices to a *.csv file. I
> used the Get (DesktopPath) function to save to the desktop. For the
> export function within FileMaker I found it necessary to put the
> "filewin" prefix. On the Mac, I had to put in at slash, before the
> filename, but not on the PC.
>
> If (
>
> //Macintosh path format
> Abs (Get ( SystemPlatform )) =1;
> Get ( DesktopPath ) &
> "\"" &
> $FileName
> ;

That slash is not supported as far as I know in MacOS. Macs don't use
the backslash in their paths. Mine works fine in FM 8.03 and FM 9
without any modification, so you might want to check that further. Or
maybe it was a typo in your post, but still, it works without
modification here.

> //PC path format
> "filewin:" &
> Get ( DesktopPath )
> &
> $FileName
> )

Yep, that's how my PC path looks now too. Thanks for the confirmation.

Re: FM 8.03 Windows get(documentsPath), Send Mail Attach problem

am 07.11.2007 13:34:28 von donotusethisaddressr

Hi Paul

Sorry about the delay. I'd copied the text of the script directly from
FileMaker. After you raised doubts, I had to go back and check if the
code actually did work. It does! I then removed the slash and it still
worked. I don't know why I put it in. Thanks for pointing it out.

Regards
Kevin Smith

On Nov 2, 10:12 pm, Paul Bruneau wrote:

> That slash is not supported as far as I know in MacOS. Macs don't use
> the backslash in their paths. Mine works fine in FM 8.03 and FM 9
> without any modification, so you might want to check that further. Or
> maybe it was a typo in your post, but still, it works without
> modification here.
>
If (

//Macintosh path format
Abs (Get ( SystemPlatform )) =1;
Get ( DesktopPath ) &
"\"" &
$FileName
;

//PC path format
"filewin:" &
Get ( DesktopPath )
&
$FileName
)