nisus.com
https://www.nisus.com/forum/

Export headings (TOC) to keynote
https://www.nisus.com/forum/viewtopic.php?f=18&t=6604
Page 1 of 1

Author:  Axbax [ 2017-02-04 11:59:28 ]
Post subject:  Export headings (TOC) to keynote

Greetings! Does anyone know of a macro or a script that allows exporting the headings of a document to keynote (or perhaps powerpoint) presentations? It would be excellent to be able to create presentations from the outline in Nisus Writer Pro.

Thanks in advance.
Kenneth

Author:  adryan [ 2017-02-06 15:06:59 ]
Post subject:  Re: Export headings (TOC) to keynote

G’day, Kenneth et al

I agree, this could be useful on occasion.

I’m afraid I don’t have time to work on a full solution at present, but after a bit of experimentation I’ve found the crucial AppleScript expressions for inserting text into a Keynote slide. As with so many things with AppleScript, the answers are by no means obvious!

Code:
tell application "Keynote"
   activate
   make new document
   tell document 1
      tell slide 1
      -- Quoted strings are sample text.
         set object text of default title item to "My Slide Title"
         set object text of default body item to "My slide contents."
      end tell
   end tell
end tell


The general idea would be to transform your Nisus outline into a list in AppleScript, then add loops to the above rudimentary code to create and populate successive Keynote slides using items from the list.

Cheers,
Adrian

Author:  adryan [ 2017-02-06 22:19:39 ]
Post subject:  Re: Export headings (TOC) to keynote

G’day, all

It may not be amiss here to alert those new to using AppleScript to link different applications, to the somewhat patchy nature of AppleScript support in the big bad world out there, even amongst Apple’s own products. There is little point in producing the most elegant code for one part of a project, only to encounter subsequently an insurmountable obstacle in another part.

My advice (and practice) is to identify critical steps in a project and attempt to get workable code for these steps, in decreasing order of difficulty. In the current situation, I know that Nisus Writer has very good AppleScript support (particularly with its handy Do Menu Macro command), whereas Keynote’s support was uncertain (ie, I was not sufficiently familiar with it). To my mind, getting text (regardless of source) into a Keynote slide was likely to be the make-or-break step, which is why I tried to solve that problem first. Just as well, as the AppleScript dictionary for Keynote is insufficiently explicit in showing the way.

There may well be further difficulties in fleshing out this project, but a cursory consideration doesn’t flag any that would deter me from pursuing the project further. AppleScript abounds with irritations, but irritations can be dealt with: impossibilites cannot.

Cheers,
Adrian

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/