2016-03-06 21 views
0

設置變量空單元格的值從未使用AppleScript工作,我只是用編碼的AppleScript和數字誤差在數量

tell application "Numbers" 
    tell front document to tell sheet 1 to tell table 1 
    set col to 3 
    repeat 
     set ABCD to value of cell {row 2, column col} 
     if value of cell {row foundRow, column col} is missing value then display dialog "yay" 
     exit repeat 
     set col to col + 1 
    end repeat 
end tell 

hobbiest我四分五裂的代碼,並簡化爲你,但無論怎樣我骰子這試圖拉動單元格的值爲空的單元格的值給我一個錯誤,我甚至無法拉出值來測試它...缺少值...所以我無所適從不勝感激

回答

0

我沒有數字,所以我不能測試這段代碼,但是我會從我所看到的中對它做出一些改變。看起來你正在試圖找到一個空白列?在你的問題中你沒有說得很清楚。如果是這樣,我會嘗試這樣的事情。 (同樣,這是未經測試的)

set foundBlank to false 
set lastColumnToCheck to 30 

tell application "Numbers" 
    tell table 1 of sheet 1 of front document 

    repeat with col from 3 to lastColumnToCheck 
     set ABCD to value of cell {row 2, column col} 
     if ABCD = "" then 
      set foundBlank to true 
      exit repeat 
     end if 
    end repeat 
end tell 

if foundBlank then 
    display dialog "Yay!" 
else 
    display dialog "Boo!" 
end if