syn presentationĬontains slides, master slides contained by application.ĭocument theme ( theme, r/o) : The theme assigned to the document. (†Not helped by the fact that Apple's developer documentation on how Apple event automation actually works and how to implement it well is dreadful too.Document n : The Keynote document. If you find it's the app and decide to file a bug report (which sometimes works and other times doesn't), make sure to include the AppleScript code that illustrates the problem AS is the de-facto standard and JXA is not, so it'll be one less layer of obfuscation and potential bugs for troubleshooters to wade through. Both the CocoaScripting framework (used to implement Apple event support in macOS Apps) and JXA have a lot of defects and deficiencies, plus of course individual scriptable apps can contain their own bugs and bad design too†, so you'll have to figure out if it's the app or JXA that is failing through process of elimination.įrom your description of observed behaviors and knowing that Apple's own scriptable apps are often buggy and ill-designed, I'm leaning towards the app, but I haven't touched iWork apps in years so can't say for sure. If it works in AS but fails when you translate it to JXA, JXA is broken. If it fails in AS then Keynote is broken. AppleScript is an awful language, but its Apple event support is second to none and it's the de-facto standard against which all scriptable apps are developed and tested. Write your code in AppleScript first and see if you can get it to work there. What is the appropriate way to create master slides, inspect their properties, and ultimately change them? In contrast, when run with the "Title & Bullets" master slide selected in "Edit Master Slide" mode, the correct values are logged. When run either outside of "Edit Master Slide" mode or in "Edit Master Slide" mode but with a different master slide selected, this code writes /* (x,y) = (0,0) */ var Keynote = Application('Keynote') Ĭonsole.log("(x,y) = (" + pos.x + "," + pos.y + ")") Ĭonsole.log("width x height = " + title.width() + " x " + title.height()) The following code should log the position, width, and height of the title item on the "Title & Bullets" master slide of the open document. Inspecting master slides has similar, but slightly different issues. This creates a new master slide named "Title & Bullets copy". If the "Edit Master Slide" button has been clicked, then it's possible to duplicate a master slide. It is possible to duplicate a master slide, but only when Keynote is in "Edit Master Slide" mode. Looking at the Script Editor Replies window, the push returns null in contrast to pushing a new Slide onto doc.slides which returns 2 (the number of slides in the array). This creates a new document but no new master slide is created. Create a new document using the "White" theme. This creates a new document with the "White" theme and appends a new "Title & Bullets" slide.Ī similar approach does not work for master slides. Create and append a new "Title & Bullets" slide.īaseSlide: doc.masterSlides It's easy to create a new document with a given theme and add slides with particular master slides to it. I'm trying to automate the creation and inspection of master slides in Keynote using JavaScript for automation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |