Inconsequential to the matter at hand; some flavors of markdown use the
_ character for italics and prefacing it with a backslash says “no, I really want it to be an underscore.”
It works like this:
- Hype asks a question of the export script or asks it to do something. It does this by executing your script with command line arguments.
- The export script returns the requested information or performs any actions it wants. You do this by writing JSON to standard output and exiting.
get_options. This is Hype asking the Export Script for items like how Hype’s export should be configured and what UI should be presented. Your script is responsible for letting Hype know.
It may be easiest to look at the debugging logs for a functional export script. Here’s
get_options for the DoubleClick Campaign Manager script (slightly cleaned up for clarity):
Hype calls the script with arguments:
running: /Users/deutschj/Library/Application Scripts/com.tumult.Hype2/DoubleClickDCM/DoubleClick DCM.hype-export.py --get_options --hype_version 4.0.0 --hype_build 599
(You could run this type of command yourself from Terminal when debugging)
The export script outputs a JSON dictionary and exits with:
The Hype application then uses this data.
This call is for changing the value of resources only. The original use case was ad tech systems that needed to change “myimage.jpg” to something like “$$_AD_SYSTEM_FILE[‘myimage’]$$” because they perform substitutions themselves later.
You can likely ignore any calls with this argument for your purposes.
This is the main call that you want. This is the final call of the export script lifecycle - it is basically saying “Hype has written everything it knows about out to a temporary directory, can you make your final changes and then put it in the spot the user requested?”
So in this call, you would take hype output, and package it into an Xcode project folder at the user’s save location.
Hype needs to call get_options at startup, as this is how Hype decides how to display information about your export script. It isn’t asking to export, just getting the options . It makes more calls on preview/export.
That’s on you! Hype export scripts have a basic protocol of taking command-line arguments and needing to return JSON as the documentation specifies. Beyond that it is up to you. There’s nothing to say you couldn’t base it in Python and use JXA for talking to Xcode if you are using apple events, for instance.