HOW TO: Control OnTheAir CG remotely (AppleScript or HTTP)

The article below will explain the possible ways to control OnTheAir CG remotely for third parties, or other users who want to know what kind of integration can be done.

If you want to control OnTheAir CG from OnTheAir Video or OnTheAir Node, this won't really help, and you should rather read the following articles:

 

Installing the example documents

When installing OnTheAir CG you will be able to install some example documents.

OTACG_Installer.png

  • Simple Projects: are as its name implies some simple project samples to show you what can be done
  • AppleScripts: Are sample documents (CG project and AppleScript itself) to show how to control OnTheAir CG Server with AppleScripts
  • HTML PAges: Are sample documents (CG projects and HTML pages) to show you how to control OnTheAir CG Server with the REST API

 

The documents will be installed in the /Applications/OnTheAir CG/ folder, in various subfolders:

OTACG_Docs.png

 

 

Controlling OnTheAir CG with AppleScripts

We won't give an extensive course on AppleScripts here, as there is a lot that can be done. We will just give you the basics, so you can create your own.

 

Install and configure OnTheAir CG Server

 

 

When you run the installer with the option to install the AppleScripts example, this will install 4 documents in the Applications folder:

  • one CG project and one AppleScript for basic examples
  • one CG project and one AppleScript for a "Score and Counter" example

Once installed:

  • start OnTheAir CG Server and configure the playback settings so you can see the output of OnTheAir CG Server. If you don't have a video device to test, you can use the same trick that is explained with the direct link here: https://www.youtube.com/watch?v=SseHZ4UsQ3o 
  • Make sure that "AppleScript Remote Control" is enabled in the "OnTheAir CG Server preferences > General":

OTACG_Pref_General_AppleScript.png

 

Use the examples provided

To test the examples provided:

  • Open the sample projects in OnTheAir CG Server
  • Start them
  • Then start the AppleScript

 

AppleScript Examples Project

With that AppleScript you will then see the text on screen being modified, and then later on the shapes moving. If you look at the AppleScript itself, you will see some explanations of what is done, but it should be easy to "read".

This is quite a simple AppleScript, and there are many things that can be done. To have the complete dictionary, the easiest is to either drag and drop the OnTheAir CG Server application on the application "Script Editor", OR in the application "Script Editor" select the menu "File > Open Dictionary..."

 

ScoreAndCounter Project

This project show how to have a simple counter in OnTheAir CG. The time will count up, but you can modify it to do a count down if that is what you need.

 

Controlling OnTheAir CG from any browser

The sample HTML documents provided are a good base for you to know how this works. You can have a web developer start from there and adapt the page to fit your needs. Don't hesitate to ask us questions if you have.

Install and configure OnTheAir CG Server

For this example, you will need to enable the option "HTML Pages (REST API)" when running the OnTheAir CG Installer. This will install a few documents.

once installed:

  • start OnTheAir CG Server and configure the playback settings so you can see the output of OnTheAir CG Server. If you don't have a video device to test, you can use the same trick that is explained with the direct link here: https://www.youtube.com/watch?v=SseHZ4UsQ3o 
  • Make sure that "HTTP Remote Control" is enabled in the "OnTheAir CG Server preferences > General":

OTACG_Pref_General_HTML.png

  • You may also want to check which port number should be used (we would recommend to keep 2001), and define a new password (the default password is 1234).
  • If you enable the option to "Publish all items", all the items within the CG projects will be modifiable by the API and will be listed. So we do not recommend enabling this option.
  • Then you should enable the option "Custom Pages" and select the folder in which the HTML examples are located. 
  • Note that you must quit and restart OnTheAir CG Server to apply those changes.

You can then open the "Read Me" document that is located next to the HTML pages, to have further instructions on how the example projects work.

Screen_Shot_2017-10-18_at_11.29.39.png

 

About the REST API

If you have a look at the code of the html sample page attached here, you will see that we use a REST API to communicate with OnTheAir CG Server. We use a few things here, but there are many other things that can be done. For the complete list of requests that can be done in REST, simply start a OnTheAir CG Server application, then on the same computer enter this url in Safari:

http://127.0.0.1:2001/api.html

The page that will open will show you all the instructions for the REST API protocol.

 

 

Have more questions? Submit a request

Comments

Powered by Zendesk