I have recently acquired a Macbook Pro (OS X Yosemite 10.10.4). I find the Numbers application satisfactory to work with, but I save the file as an .xlsx file after I am done. I need to make changes to the file repeatedly and save it repeatedly as the file is used as input by a program that can only read excel files.
As a consequence, every time I make a change in the file I have to go to the Menu bar, pick export as Excel, choose to replace the pre-existing excel file. I have gone through some tutorials of applescript used for 'Numbers', but I cannot find out how to automate the process of exporting a file as Excel.
on run {input, parameters}
tell application "Numbers"
activate
tell document 1
export as xlsx
end tell
end tell
return input
end run
This is the code as it stands. Please let me know how to automate the process of exporting a numbers file as an excel file.
Best Answer
I've written a script to export to CSV originally. I've included a commented out line in that script you can switch to, to export to Excel instead:
See the gist here: https://gist.github.com/idStar/61994506d69595da3d30
Additionally, the entire script is reproduced below: