AnsweredAssumed Answered

Problems with "do shell script" in AppleScript

Question asked by dida110 on Apr 19, 2018
Latest reply on Apr 21, 2018 by TonyWhite

I have a problem with a multiple line shell script in FileMaker and I think the problem are the line breaks.

Here is my code:

"do shell script \" "& ¶ & "
if [ -d '/Volumes/lmp_adapter_com/1' ]; then" & ¶ & "
  mkdir /Volumes/lmp_adapter_com/1/pictures " & ¶ & "
else" & ¶ & "
  mkdir /Volumes/lmp_adapter_com/1" & ¶ & "
  mkdir /Volumes/lmp_adapter_com/1/pictures" & ¶ & "
fi" & ¶ & "
" & "\""

 

If I export the output into the Script-Editor from Apple there is an error:

"sh:

: command not found"

And then if I replace the line breaks everything works.

Do I have to use a different line break?

Outcomes