Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

yux

macrumors newbie
Original poster
Sep 9, 2011
6
0
(*
Hello!

I wrote the following script in order to perform a same task on every Numbers file in a folder but could not get it work. Could anyone correct me?

One thing I could think of was that I might need to specify file type so that Numbers could recognize them, but I didn't know where and how.

Another thing I suspected of was that I made some conflication between Finder and Numbers. But again I don't know how I did it if that was the problem.

Thanks in advance to anyone who can help me solve the problem!
*)


tell application "Finder"
set myFolder to alias ((path to desktop folder as text) & "tata")
set myList to every file in myFolder

tell application "Numbers"
repeat with i from 1 to length of myList
set openedDoc to open file i of myList
tell openedDoc to tell sheet 1 to tell table 1
delete (rows 80 thru 61)
end tell
close openedDoc
end repeat
end tell

end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.