Skip to content
Max Ziebell edited this page May 16, 2021 · 6 revisions

Extend the functionality of Hype with Python

Using the ever more popular Python opens up many possibilities to change the exported. There is a good and official introduction to the topic from Tumult that can be found at https://github.com/tumult/hype-export-scripts

These are some of the current export scripts by Tumult:

And the sample exports script containing most of the options

Debugging export scripts

While writing an export script you might run into error in your syntax. To get feedback on what is going on you can use the following command to get the related log output.

Enabling the debugging mode

First you need to make sure you have enabled the debugging mode. If you haven't enabled it you won't see much information in the logs or stdout. The command to enable export script debugging can be found here: https://github.com/worldoptimizer/HypeCookBook/wiki/Terminal-commands#seeing-arguments-and-capturing-output-from-export-scripts

Using the terminal to read the log

log stream --style syslog --predicate '(processImagePath contains[c] "hype") && (category != "security_exception")'

Be aware, macOS has restrictions on the length of log messages. Hence, long log entries might get truncated.

Using the console.app to read the log

When using the console.app you can search for Hype4 to find related entries. A click on the entry shows the recorded text from the log. Be aware, macOS has restrictions on the length of log messages. Hence, long log entries might get truncated.

Using stdout and running the Hype app from terminal

Thanks to a hint from Jonathan1., this is now my favorite method for debug export scripts.

/Applications/Hype4.app/Contents/MacOS/Hype4

While writing an export script the above command starts the app from the command line while capturing all the output (stdout) including the full error messages while running export scripts. This includes long messages from Python.


1. https://forums.tumult.com/t/avoid-truncated-python-errors-from-export-scripts/18865/4

Clone this wiki locally