Import/Convert

Final Draft Pro 8/9/10 (XML)

Final Draft is the industry standard software for screenwriting - for little discernible reason. Version 7 produced proprietary binary files with the .fdr extension. Version 8 introduced the more helpful (although bloated) .fdx file, structured as XML.

Simple to traverse, using simplexml_load_file or DomDocument.

    <Paragraph Type="Action">
      <Text>Wheat fields. Etched in darkness and moonlight. For the moment it’s calm.</Text>
    </Paragraph>
    <Paragraph Type="Action">
      <Text AdornmentStyle="0" Background="#FFFFFFFFFFFF" Color="#000000000000" Font="Courier Final Draft" RevisionID="0" Size="12" Style="Bold">TITLE: Nebraska, 1875.</Text>
    </Paragraph>
    <Paragraph Type="Action">
      <Text>A WOMAN CRIES OUT, drawing our attention to a scant farm house in the distance.</Text>
    </Paragraph>

Adobe Story (XML)

Adobe’s web & desktop screenwriting software, Story (https://story.adobe.com/), as part of the Creative Cloud platform, is one of the newest entrants to the market and easily the most sophisticated. As part of a larger production management system, all files are meant to inter-operate with Digital Asset Management (DAM) and film production breakdown/scheduling documents. The native Adobe Story format (ASTX) is again just simple XML which is easily traversable using simplexml_load_file or DomDocument.

Note: Story appears to have now migrated to using .stdoc files which are in a proprietary format.

Celtx (RDF)

Celtx was the first open-source platform for screenwriting that became a real competitor to Final Draft, also offering a full-production platform for independent filmmakers. A .celtx file is just a zip archive, like a .jar, .war, or .docx.The structure of the archive is as follows:

.
├── local.rdf
├── project.rdf
├── scratch-YpE.html
├── script-YpE.html

Resource Description Framework (RSS/RDF) files are simple to parse using DomDocument.

<p id="oHGP7x10" class="sceneheading">Ext. WOODS - NOON.<br></p>
<p class="action">ALEX, <span ref="http://celtx.com/res/ywj489TD9hGB"
 class="cast">JOSH</span>, GIRL 1, and GIRL 2, <span
 ref="http://celtx.com/res/I6Dr5rQJX4p4" class="cast"></span>are walking on a
trail to their campsite (which evidently is very far away). <br>
</p>
<p class="character">GIRL 2<br></p>
<p class="dialog">Are we almost there?<br></p>
<p class="character">GIRL 1<br></p>
<p class="dialog">Yea we've been walking forever.</p>

Open Screenplay Format (XML)

Possibly the newest entrant to the format market is the XML format OSF, used by Fade In Pro (http://www.fadeinpro.com/). Open Screenplay Format is a small open-source project on SourceForge which doesn’t appear to be particularly well documented, but is elegantly structured.

Note: FadeIn Pro is exceptionally helpful for converting between formats.

Once again, OSF is easy to parse using simplexml_load_string.

    <para synopsis="Calm fields of wheat. Farmland. The heart of America.&#xA;In darkness.&#xA;&#xA;Set location and time." synopsis_color="#40A0FF" note="Near Plattsmouth Nebraska.&#xA;&#xA;Rivers nearby: Platte joins Missouri River">
      <style basestylename="Scene Heading"/>
      <text>EXT. Mast farm - nIGHT</text>
    </para>
    <para>
      <style basestylename="Action"/>
      <text>Wheat fields. Etched in darkness and moonlight. For the moment it’s calm.</text>
    </para>
    <para>
      <style basestylename="Action"/>
      <text size="12" bold="1" color="#000000" bgcolor="#FFFFFF">TITLE: Nebraska, 1875.</text>
    </para>
    <para>
      <style basestylename="Action"/>
      <text>A WOMAN CRIES OUT, drawing our attention to a scant farm house in the distance.</text>
    </para>

Fountain (Markdown)

Fountain is what happens when compute nerds write films. And it’s becoming the fastest-moving format out there. Fountain is simply markdown, as used in Git repos. It’s well documented, fast, and easily integrated into different software.

Fountain has been ported into PHP by Alex King (Fountain-PHP):

Parsing markdown is a standard operation used all over the place. For example: http://parsedown.org/

INT. SMALL TOWN BANK - DAY

= Walter is denied an extension on his farm's loan

Walter sits across the desk from a BANK OFFICIAL who can’t stop wringing his hands.

BANK OFFICIAL
I’d really like to help. I really would...

WALTER
I’m not asking for a hand-out, George. It’s been a tough season. I just need more time.

BANK OFFICIAL
You’ve already exceeded the grace period. Twice.

RTF

Rich Text is a very old standard that has been around for years. Very simple to parse using RTF reader libraries available on Packagist, e.g. https://github.com/henck/rtf-html-php.

{\pard\plain \ql \caps\sb480\f66\fs24\sl180\s2\fi0\ri1440\li2160 EXT. Mast farm - nIGHT\par }
{\pard\plain \ql \sb240\f66\fs24\sl180\s3\fi0\ri1440\li2160 Wheat fields. Etched in darkness and moonlight. For the moment it's calm.\par }
{\pard\plain \ql \b\sb240\f66\fs24\sl180\s3\fi0\ri1440\li2160 TITLE: Nebraska, 1875.}
{\pard\plain \ql \sb240\f66\fs24\sl180\s3\fi0\ri1440\li2160 \par A WOMAN CRIES OUT, drawing our attention to a scant farm house in the distance.\par }
{\pard\plain \ql \caps\sb480\f66\fs24\sl180\s2\fi0\ri1440\li2160 EXT. Mast house - cONTINUOUS\par }
{\pard\plain \ql \sb240\f66\fs24\sl180\s3\fi0\ri1440\li2160 Perched on the house's front stair is HENRY MAST. He's 11 years old and anxious as anything. \par His mother's intermittent screams emanate from the house.\par Nearby his father WALTER MAST, 40's, smokes a pipe. Keeps his back to his son. Trying to hide the worry in his weathered face.\par More screams from inside.\par }
{\pard\plain \ql \caps\sb240\f66\fs24\sl180\s4\fi0\ri1800\li5040 Henry\par }
{\pard\plain \ql \sb0\f66\fs24\sl180\s6\fi0\ri3600\li3600 Was it like this with me?\par }
{\pard\plain \ql \caps\sb240\f66\fs24\sl180\s4\fi0\ri1800\li5040 Doctor\par }
{\pard\plain \ql \sb0\f66\fs24\sl180\s6\fi0\ri3600\li3600 I'm sorry, Walter.\par }