missing value というエラー

macのNumbersでゲームの設定データを用意して、applescriptcvsファイルにコンバートしていたのですが、なぜか空白のセルのデータが"missing value"という文字列に化けるようになってしまいました。
原因は良く判らないのですが、OSのバージョンが変わったためかも知れません。とほほ。


appleScriptと格闘したり、ググったりしたのですが、さっぱり分かりません。
絶望の縁でアレコレ弄っていたら何とかなりましたので、備忘録として記載。

set cv to value of offsetCell's cell
if cv is missing value then
	set textBuffer to textBuffer & ","
else
	set textBuffer to textBuffer & "," & cv
end if


とやっていたのですが、全然ダメ。
cvの値を表示させるとmissing valueなのですが、(cv is missing value)はfalseになるばかり。
セルに"_"を入れて、cvの値を"_"と比較して、というのもダメ。

set cv to value of offsetCell's cell
if cv is "_" then
	set textBuffer to textBuffer & ","
else
	set textBuffer to textBuffer & "," & cv
end if


どうも、Numbersのセルの値が何か違う形式になっているようです。
そこで、

set cv to value of offsetCell's cell as string
if cv is "_" then
	set textBuffer to textBuffer & ","
else
	set textBuffer to textBuffer & "," & cv
end if

とやってみると、上手くいく!
もしや! と閃いて、下のようにした所上手くいきました。

set cv to value of offsetCell's cell as string
if cv is "missing value" then
	set textBuffer to textBuffer & ","
else
	set textBuffer to textBuffer & "," & cv
end if


文字列にキャストして、文字列として比較すれば良かった、というお話でした。