0

I want to sort a Numbers table using Javascript for Automation, the code like

table.sort(table.columns["P"], {direction: "descending"})

But the Script Editor told me: Parameter is missing. (-1701)

the sort method

Here is the code I wrote:

 var Numbers = Application("Numbers")
 var path = Path("/Volumes/sfufoet/test.numbers")

 var doc = Numbers.open(path)

 var sheet = doc.sheets[1]
 var table = sheet.tables[1]

 table.sort(table.columns["P"], {direction: "descending"})

Thanks!

0

1 Answer 1

1

I found it!

the right code is:

table.sort({by:table.columns["P"], direction: "descending"})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.