I am trying to write an applescript to open a Numbers file and perform some tasks with the file, say display the row count of the file. Here is what I wrote:
tell application "Numbers"
tell application "Finder"
set theFile to file "myfolder:myfile.numbers"
open theFile
end tell
-- the above part works well
tell document theFile to tell sheet 1 to tell table 1
set z to row count
end tell
end tell
display dialog ("The row count is" & z)
The open file part works well, but I cannot get the opened file referred to, no matter what. Could anyone teach me how to solve this problem? Thanks!
tell application "Numbers"
tell application "Finder"
set theFile to file "myfolder:myfile.numbers"
open theFile
end tell
-- the above part works well
tell document theFile to tell sheet 1 to tell table 1
set z to row count
end tell
end tell
display dialog ("The row count is" & z)
The open file part works well, but I cannot get the opened file referred to, no matter what. Could anyone teach me how to solve this problem? Thanks!