Applescript iWork error
I have just started working with applescript instead of automator. I tried to make a program which added a column in a spreadsheet after a, then filled the top ten rows of that collumn with the word name. Why does the following code not work?:
set thisCSVFile to choose file
if (thisCSVFile as string) ends with ".csv" then
tell application "Numbers"
open thisCSVFile
tell front document
tell table 1 of sheet 1
add column after column "A"
repeat with a from 1 to 10
set value of cell a of column "B" to "name"
end repeat
end tell
end tell
end tell
iMac, Mac OS X (10.7)