You can also watch this video at YouTube (but with ads).
Here’s the text of the script:
var Numbers = Application("Numbers");
var Keynote = Application("Keynote");
var table = Numbers.documents[0].sheets[0].tables[0];
var presentation = Keynote.documents[0];
var slideMaster = presentation.masterSlides["Title & Subtitle"];
for(var i=1;i<table.rowCount();i++) {
var newSlide = Keynote.Slide({baseSlide:slideMaster});
presentation.slides.push(newSlide);
newSlide.defaultTitleItem().objectText = table.rows[i].cells[0].value();
var newSlide = Keynote.Slide({baseSlide:slideMaster});
presentation.slides.push(newSlide);
newSlide.defaultTitleItem().objectText = table.rows[i].cells[0].value();
newSlide.defaultBodyItem().objectText = table.rows[i].cells[1].value();
}
very slick Gary, looking forward to more programming examples, great way to learn Java !
This is super. I'm also very interested in writing little scripts for the Mac. Thanks!
(Club MacMost patron ;)
Nice one. Could you please make the script available as a starting point for experimentation?
Eric: I'm put the script under the video above for those that wish to copy and paste.
This script was a great help! Do you know how to add another text box and fill it the same way as defaultTitleText and defaultBodyText??
Additionally, do you know how I could use a lookup script to update these text boxes? (example would be updating prices in a product portfolio).
Thanks again!
John: Looks like we only have those two existing text boxes to work with in scripts. The other idea may be possible, but I can't think of how to do it offhand. You'd need to start experimenting and work at it to figure to out.
Trying to get from the "fish"to the "fishing": Is there some documentation (presumably by Apple) to find out about those pre-defined capabilities of Numbers and Keynote? I. e. how do I find out that it's "presentation.masterslide" or "newSlide.defaultTitleItem().objectText()"?
Dorit: There is documentation in the Script Editor app. Use Window, Library to open the topic list. Then dig into a topic. But remember to switch from AppleScript to JavaScript at the top of the documentation window. The information here is just a reference and is sorely locking in examples.