Monday, December 11, 2017

#1 2017-09-15 09:06:30 pm

jbh
Member
Registered: 2017-04-05
Posts: 4

script opens Numbers document ok but then gives error -1728

Seems strange that this script will open Test.numbers but then fails on the get value statement with  "Numbers got an error: Can’t get document ...." number -1728 .

Is this the expected behaviour?

Applescript:

set theDoc to (path to desktop as string) & "Test.numbers"
tell application "Numbers"
   open theDoc
   tell table 1 of sheet 1 of document theDoc
       tell row 2
           get value of cell 1
       end tell --row
   end tell --table
end tell


Filed under: Error, numbers

Offline

 

#2 2017-09-15 10:06:17 pm

jbh
Member
Registered: 2017-04-05
Posts: 4

Re: script opens Numbers document ok but then gives error -1728

Whoops!

If I had written

tell table 1 of sheet 1 of front document

instead of

tell table 1 of sheet 1 of document theDoc

the error would not have occurred.

Sorry for wasting time.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)