How can I create a script with multi command
You have saved your file as a Rich Text Format file (.rtf)

In TextEdit.app

Open your file and use the Make Plain Text menu to change it to the correct format for coding.

Using anything other than plan text will mean that the file includes formatting code  for styles and such that is visible to the shell layer but not to the user when viewing the file.

For example.

Rich Text Format file with the extension changed is still a rich text file





Reading it from the command line.

$ cat foo.command

{\rtf1\ansi\ansicpg1252\cocoartf1344\cocoasubrtf720
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red43\green39\blue19;\red234\green234\blue234;\red37\green127\blue159;
}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab720
\pard\pardeftab720

\f0\fs26 \cf2 \cb3 \expnd0\expndtw0\kerning0
defaults write com.apple.finder \cf4 \expnd0\expndtw0\kerning0
CreateDesktop\cf2 \expnd0\expndtw0\kerning0
 -bool true}




Change to plain text and re saved.









Read from the command line.

$ cat foo.command
defaults write com.apple.finder CreateDesktop -bool true


( examples are for illustration only and not how to do the actual coding)