Coder Social home page Coder Social logo

saurabharch / slideshow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rse/slideshow

0.0 2.0 0.0 94 KB

Slideshow -- Observe and Control Slideshow Applications

Home Page: https://www.npmjs.org/package/slideshow

License: Mozilla Public License 2.0

JavaScript 35.43% Makefile 1.30% AppleScript 53.81% Shell 8.30% Batchfile 1.17%

slideshow's Introduction

Slideshow

Observe and Control Slideshow Applications

Abstract

Slideshow is a Node/JavaScript Application Programming Interface (API) and Command Line Interface (CLI) for observing and controlling the slideshow presentation applications Microsoft PowerPoint 2010/2013/2016 for Windows, Microsoft PowerPoint 2011/2016 for Mac OS X and Apple KeyNote 5/6 for Mac OS X. It can determine the current state of the application, gather information about the slides and control the application's slideshow mode. It is implemented as a thin Node/JavaScript API layer on top of platform-specific Windows WSH/JScript and Mac OS X Automator AppleScript/JavaScript connectors. No native code is required.

Installation

Use the Node Package Manager (NPM) to install this module locally (default) or globally (with option -g):

$ npm install [-g] slideshow

Usage

#   CLI variant
slideshow powerpoint boot
slideshow powerpoint open sample.pptx
slideshow powerpoint start
slideshow powerpoint goto 2
sleep 2
slideshow powerpoint stop
slideshow powerpoint close
slideshow powerpoint quit
//  API variant
var SlideShow = require("slideshow")
var slideshow = new SlideShow("powerpoint")
slideshow.boot()
.then(function () { slideshow.open("sample.pptx") })
.then(function () { slideshow.start() })
.then(function () { slideshow.goto(2) })
.delay(2*1000)
.then(function () { slideshow.stop() })
.then(function () { slideshow.close() })
.then(function () { slideshow.quit() })
.then(function () { slideshow.end() })
.done()

Architecture

The architecture of Slideshow fulfills the following constraints:

  1. No Native Code: There should be no native code required because this is nasty (especially under Windows) during module installation time (because a compiler is required). The solution is to leverage the scripting environment of the particular platform (Windows Scripting Host (WSH) under Windows and AppleScript under Mac OS X).

  2. Separate Platform Specifics: The platform specific code should be kept separate (because else the infrastructure code would have to be duplicated). The solution is the splitting as seen below.

  3. Universal Platform Interface: The communication between the Node process and the platform specific process should be universal (because else we need multiple communication variants). The solution is to use simple stdio based communication.

The architecture in particular looks like this:

+-------------------------------------------------+
|  node                                           |
+-------------------------------------------------+
+-------------------------------------------------+
|  Slideshow CLI (slideshow-cli.js) or App        |
+-------------------------------------------------+
+-------------------------------------------------+
|  Slideshow API (slideshow-api.js)               |
+-------------------------------------------------+
+-------------------------------------------------+
|  Connector API (connector.js)                   |
+-------------------------------------------------+
      |              |              |
+------------+ +------------+ +------------+ +-- -
|command.com | |sh          | |sh          | |
+------------+ +------------+ +------------+ +-- -
+------------+ +------------+ +------------+ +-- -
|win-ppt.bat | |osx-ppt.sh  | |osx-kn.sh   | |
+------------+ +------------+ +------------+ +-- -
      |             |             |
+------------+ +------------+ +------------+ +-- -
|cscript     | |osascript   | |osascript   | |
+------------+ +------------+ +------------+ +-- -
+------------+ +------------+ +------------+ +-- -
|win-ppt.js  | |osx-ppt.scpt| |osx-kn.scpt | |
+------------+ +------------+ +------------+ +-- -

Presentation Application Support Status

  • SUPPORTED: Microsoft PowerPoint 2010 under Windows:
    Fully supported through connector-win-ppt2010, which uses Windows Scripting Host (WST)'s JScript engine and the Component Object Model (COM) of PowerPoint.

  • SUPPORTED: Microsoft PowerPoint 2013 under Windows:
    Expected to be supported (but not tested by the author) through connector-win-ppt2010, which uses Windows Scripting Host (WST)'s JScript engine and the Component Object Model (COM) of PowerPoint.

  • SUPPORTED: Microsoft PowerPoint 2016 under Windows:
    Expected to be supported (but not tested by the author) through connector-win-ppt2010, which uses Windows Scripting Host (WST)'s JScript engine and the Component Object Model (COM) of PowerPoint.

  • SUPPORTED: Microsoft PowerPoint 2011 under Mac OS X:
    Fully supported through connector-osx-ppt2011, which uses AppleScript engine and the application Dictionary of the PowerPoint:mac variant.

  • SUPPORTED: Microsoft PowerPoint 2016 under Mac OS X:
    Fully supported through connector-osx-ppt2011, which uses AppleScript engine and the application Dictionary of the PowerPoint:mac variant.

  • SUPPORTED: Apple Keynote 5 under Mac OS X:
    Fully supported through connector-osx-kn5, which uses AppleScript engine and the application Dictionary of Keynote.

  • PARTIALLY SUPPORTED: Apple Keynote 6 under Mac OS X:
    Partially supported through connector-osx-kn6, which uses AppleScript engine and the application Dictionary of Keynote. Currently partially broken up to at least Keynote 6.2.2 (August 2014), because the AppleScript support in Keynote 6 still lacks many things Keynote 5 already supported. The main problem currently is that one cannot detect whether a slideshow is playing and that slide changing is reflected in AppleScript only once the Keynote window lost its focus.

  • STILL UNSUPPORTED: LibreOffice 4 Impress under Windows/Mac OS X/Linux:
    Currently not supported, but there are two possible approaches for the future: the newer LibreOffice Impress Remote Protocol or the older Universal Network Objects (UNO) Java interface.

  • STILL UNSUPPORTED: OpenOffice 4 Impress under Windows/Mac OS X/Linux:
    Currently not supported, but there is one possible approach for the future: the Universal Network Objects (UNO) Java interface.

License

Copyright (c) 2014-2017 Ralf S. Engelschall <http://engelschall.com>

This Source Code Form is subject to the terms of the Mozilla Public License (MPL), version 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

slideshow's People

Contributors

rse avatar

Watchers

James Cloos avatar saurabh kashyap avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.