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"
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"
As presented above, your script is missing the final "end if" but you should get an error message telling you that when you try to compile it.
I added that final end statement and ran it with a csv file I had and, as far as I could tell, it did what it was supposed to do. What doesn't work for you?
Retrieving data ...