Reply to topic  [ 3 posts ] 
Export headings (TOC) to keynote 
Author Message

Joined: 2017-02-04 11:55:59
Posts: 6
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


2017-02-04 11:59:28
Profile

Joined: 2014-02-08 12:57:03
Posts: 169
Location: Australia
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

_________________
MacBook Pro (mid-2014)
macOS Sierra 10.12.6
Nisus Writer user since 1996


2017-02-06 15:06:59
Profile

Joined: 2014-02-08 12:57:03
Posts: 169
Location: Australia
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

_________________
MacBook Pro (mid-2014)
macOS Sierra 10.12.6
Nisus Writer user since 1996


2017-02-06 22:19:39
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: Bing [Bot], ScottinPollock and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software