【发布时间】:2016-09-21 07:16:38
【问题描述】:
我有一个保存文本文件的脚本:
将 myNote 设置为 " 文本 文本 文字
more text: " & variable 1 & "
" & variable 2 & "
" & variable 3 & "
" & variable 4 & "
More text ....
" & Variable 5 & "
“问题”是变量有时是空白的,所以我在文本之间有几个空行
喜欢:
更多文本:变量 1
变量 3
更多文字 .... 变量 5
如果变量没有值,如何删除空行?
我应该将变量设置为缺失值而不是“”,还是这样做?
我的第二个想法是
If variable1 is not = to " " then
Set note1 to variable1
End if
设置
note1 to
Text
Text
Text
Set note2 to
more text: " & variable 1 & "
Set note3 to
" & variable 2 & "
设置note1 ¬e2 和note3
【问题讨论】:
标签: variables text applescript missing-data