filemaker>applescript>do shellscript - syntax

I have succesfully bashed from terminal:
lp -d Internal_Modem -o phone=9999999 /Users/TWS/documents/tempx
followed by
open /Users/TWS/Library/Printers/“Internal”

thus sending a fax
and viewing its send progress

but sending a fax from within filemaker [ Applescript - “do shellscript” ] script has been challanging
how to correctly imbed spaces within variable names and file names > some with hidden extensions is trickey
had it for a moment , lost it and have spent hours and hours tryin to get the syntax right

example format pattern;
do shell script lp -d Internal Modem -o phone= [current filemaker field value with space in name] [filepath / (some names with spaces & or hidden extensions)]

close to workable filemaker script;
“do shell script”&“"”&“lp -d Internal_Modem -o phone=”&job to payee::fax number&" ‘“&”/Users/TWS/Documents/temp.pdf"&"’“&”""

any tips would be most appreciated.

Are you aware there is a FileMaker Plugin available that will allow you to run shell commands straight from FileMaker. Check it out at: