Also this line will fail, with the NoVarsInStrings turned on.
 Code:
$Attachments = DirList("$home\$doc\(current month)",2)

Change it to...
 Code:
$Attachments = DirList($home+"\"+$doc+"\(current month)",2)