Why round-trip?
Round-tripping is the cheapest way to sanity-check a converter. If
A.fdx → A.json → A2.fdx produces an A2.fdx that Final Draft opens
and that renders identically, your conversion is clean.
Commands
# 1. Convert
screenjson convert -i original.fdx -o step1.json
# 2. Validate
screenjson validate -i step1.json --strict
# 3. Export back
screenjson export -i step1.json -f fdx -o roundtripped.fdx
# 4. Re-convert to confirm stability
screenjson convert -i roundtripped.fdx -o step2.json
# 5. Diff the two ScreenJSON documents
diff <(jq -S . step1.json) <(jq -S . step2.json)
The only differences you should see across re-parses are UUIDs (if the CLI mints new ones on the second convert) and timestamps.
In a script
#!/usr/bin/env bash
set -e
src="$1"
name="$(basename "$src" .fdx)"
screenjson convert -i "$src" -o "${name}.json"
screenjson validate -i "${name}.json" --strict
screenjson export -i "${name}.json" -f fdx -o "${name}-rt.fdx"
echo "OK — ${name}-rt.fdx"