XML TTML

[TTML]現時点でのまとめ(自分用 更新202408)

DaVinci Resolve 19で書き出しパネルに(日本語のローカライズ)に変更が入った
TTMLのIMSC1と
TTMLのDFXPがわかりやすく表示されるようになった

20240826125038_259x120

2024時点ではTTML=IMSC1のことを指す場合が多い
少し前の機材の場合だとDFXP対応のみはあり得る。が
まぁ内容はTT宣言部分のアトリビュート属性だけの違いで
IMSC1
ttp:profile="http://www.w3.org/ns/ttml/profile/imsc1/text"
DFXP
ttp:profile="http://www.w3.org/ns/ttml/profile/dfxp-presentation"
書き出し結果に
内容に違いはほとんど無いため、IMSC1で処理していっても問題ない



DaVinci Resolveの場合
フォーマット有りのSRTファイルとVTTファイルがホボ内容が同じになる
文字種や色を制御するならVTTになるけど
フォーマット有りのSRTファイルがサポートされている場合は
SRTも選択肢



ここから更新前情報と同じ


Timed Text Markup Language 1 (TTML1) - W3C

https://www.w3.org/TR/2018/REC-ttml1-20181108/


Timed Text Markup Language 2 (TTML2) - W3C

https://www.w3.org/TR/2018/REC-ttml2-20181108/



iTT (iTunes Timed Text)

iTunes Video and Audio Asset Guide 5.3.12 

Lyrics Example Annotations


[TTML] TTMLファイルにiTT (iTunes Timed Text)の要素の付与

https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-dc3854.html




TTML関連

カテゴリー

https://quicktimer.cocolog-nifty.com/icefloe/cat76053036/index.html


LRC関連

https://quicktimer.cocolog-nifty.com/icefloe/cat76053331/index.html


SRT関連

https://quicktimer.cocolog-nifty.com/icefloe/cat76053335/index.html


FFMETADATA1

https://quicktimer.cocolog-nifty.com/icefloe/2023/04/post-dd127e.html


[TTML]編集にはVisual Studio Codeと機能拡張がベター

https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-bf9686.html




Mac表示

Screen-20230112-120243

モバイル表示

Screen-20230112-120429




JEDIT用カラーリングファイル

ダウンロード - ttml_coloring.plist






【留意】

R0-R2等上部に設定すると、iPhone等のカメラの出っ張りに隠れてしまう表示がある

なので

意図したポジションにCCを出したい場合は

R4からR10ぐらいが確実かもしれない

通常の1行の場合はR14にしておけば良いのか?な?



ポジションサンプル(現時点)

留意:displayAlignはafterで換算しています

extentを0%設定しているのは、値を入れると『現時点で』意図する表示にならないので0%にしていますが、本来は文字のサイズに対応して5%ぐらいを指定するのが良いのかも?しれない

    <layout>

      <region xml:id="R0" tts:origin="0.000% 5%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R1" tts:origin="0.000% 19%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R2" tts:origin="0.000% 25%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R3" tts:origin="0.000% 29%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R4" tts:origin="0.000% 34%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R5" tts:origin="0.000% 40%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R6" tts:origin="0.000% 45%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R7" tts:origin="0.000% 50%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R8" tts:origin="0.000% 56%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R9" tts:origin="0.000% 61%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R10" tts:origin="0.000% 67%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R11" tts:origin="0.000% 72%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R12" tts:origin="0.000% 80%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R13" tts:origin="0.000% 86%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R14" tts:origin="0.000% 95%" tts:extent="100.000% 0%" tts:displayAlign="after" />

    </layout>


ツール類 基本XMLなので
Visual Studio Code
https://code.visualstudio.com/
Visual Studio Code用機能拡張 
XML Tools
https://marketplace.visualstudio.com/items?itemName=DotJoshJohnson.xml
Red HatのXMLはソースの閲覧には良いが 編集には向かない(執筆時点)
https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml

ツール類
ssa2srt
https://strawberrysw.com/ssa2srt/
Screen-5


ツール類
Jubler Subtitle Εditor
https://www.jubler.org
Jublerscreenshotwebp


記事発行時点でYoutubeではlayout内にstyleを記述すると
一部の属性で無視される
202404130147371536x1092


ポジショニングについてのメモ
[TTML]横書き字幕のポジション(Youtube用)
https://quicktimer.cocolog-nifty.com/icefloe/2024/05/post-d06363.html


縦書き関連
[TTML] 縦書き字幕 originとして指定はおおむね8箇所
https://quicktimer.cocolog-nifty.com/icefloe/2024/04/post-77d63f.html

[DaVinci Resolve]縦書き字幕用TTMLにラインセパレーターが混入する
https://quicktimer.cocolog-nifty.com/icefloe/2024/04/post-96a024.html

横書きTTMLを縦書き表示(Youtube用の
による縦書き)変換
https://quicktimer.cocolog-nifty.com/icefloe/2024/04/post-743ce2.html

縦書き置換用正規表現
([\p{Hiragana}\p{Katakana}\p{Han}])
\1<br />

202404150249351002x736

|

[TTML]現時点でのまとめ(自分用 更新)

Timed Text Markup Language 1 (TTML1) - W3C
https://www.w3.org/TR/2018/REC-ttml1-20181108/

Timed Text Markup Language 2 (TTML2) - W3C
https://www.w3.org/TR/2018/REC-ttml2-20181108/

iTT (iTunes Timed Text)
iTunes Video and Audio Asset Guide 5.3.12 
Lyrics Example Annotations

[TTML] TTMLファイルにiTT (iTunes Timed Text)の要素の付与
https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-dc3854.html


TTML関連
カテゴリー
https://quicktimer.cocolog-nifty.com/icefloe/cat76053036/index.html

LRC関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053331/index.html

SRT関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053335/index.html

FFMETADATA1
https://quicktimer.cocolog-nifty.com/icefloe/2023/04/post-dd127e.html

[TTML]編集にはVisual Studio Codeと機能拡張がベター
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-bf9686.html


Mac表示
Screen-20230112-120243

モバイル表示
Screen-20230112-120429


JEDIT用カラーリングファイル

ダウンロード - ttml_coloring.plist




【留意】
R0-R2等上部に設定すると、iPhone等のカメラの出っ張りに隠れてしまう表示がある
なので
意図したポジションにCCを出したい場合は
R4からR10ぐらいが確実かもしれない
通常の1行の場合はR14にしておけば良いのか?な?

ポジションサンプル(現時点)
留意:displayAlignはafterで換算しています
extentを0%設定しているのは、値を入れると『現時点で』意図する表示にならないので0%にしていますが、本来は文字のサイズに対応して5%ぐらいを指定するのが良いのかも?しれない

    <layout>

      <region xml:id="R0" tts:origin="0.000% 5%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R1" tts:origin="0.000% 19%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R2" tts:origin="0.000% 25%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R3" tts:origin="0.000% 29%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R4" tts:origin="0.000% 34%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R5" tts:origin="0.000% 40%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R6" tts:origin="0.000% 45%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R7" tts:origin="0.000% 50%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R8" tts:origin="0.000% 56%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R9" tts:origin="0.000% 61%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R10" tts:origin="0.000% 67%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R11" tts:origin="0.000% 72%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R12" tts:origin="0.000% 80%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R13" tts:origin="0.000% 86%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R14" tts:origin="0.000% 95%" tts:extent="100.000% 0%" tts:displayAlign="after" />

    </layout>


ツール類 基本XMLなので
Visual Studio Code
https://code.visualstudio.com/
Visual Studio Code用機能拡張 
XML Tools
https://marketplace.visualstudio.com/items?itemName=DotJoshJohnson.xml
Red HatのXMLはソースの閲覧には良いが 編集には向かない(執筆時点)
https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml

ツール類
ssa2srt
https://strawberrysw.com/ssa2srt/
Screen-5


ツール類
Jubler Subtitle Εditor
https://www.jubler.org
Jublerscreenshotwebp


記事発行時点でYoutubeではlayout内にstyleを記述すると
一部の属性で無視される
202404130147371536x1092


ポジショニングについてのメモ
[TTML]横書き字幕のポジション(Youtube用)
https://quicktimer.cocolog-nifty.com/icefloe/2024/05/post-d06363.html


縦書き関連
[TTML] 縦書き字幕 originとして指定はおおむね8箇所
https://quicktimer.cocolog-nifty.com/icefloe/2024/04/post-77d63f.html

[DaVinci Resolve]縦書き字幕用TTMLにラインセパレーターが混入する
https://quicktimer.cocolog-nifty.com/icefloe/2024/04/post-96a024.html

横書きTTMLを縦書き表示(Youtube用の
による縦書き)変換
https://quicktimer.cocolog-nifty.com/icefloe/2024/04/post-743ce2.html

縦書き置換用正規表現
([\p{Hiragana}\p{Katakana}\p{Han}])
\1<br />

202404150249351002x736

|

横書きTTMLを縦書き表示(Youtube用の<BR /> による縦書き)変換


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# TTMLを縦書きにします→文字毎に改行入れるだけw
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application


##############################################
## ファイルパス関連
##############################################
####ダイアログで使うデフォルトロケーション
tell application "Finder"
  set aliasDefaultLocation to (path to desktop folder from user domain) as alias
end tell
####UTIリスト XMLのみ
set listUTI to {"dyn.ah62d4rv4ge81k7drru", "public.xml"}
####プロンプトテキスト
set strPromptText to "TTMLファイルを選んでください" as text
####ダイアログを出す
set aliasFilePath to (choose file with prompt strPromptText default location (aliasDefaultLocation) of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias

##############################################
## ファイルパス関連
##############################################
set strFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePath to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePathURL to refMe's NSURL's fileURLWithPath:(ocidFilePath)
#
set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
set ocidBaseFilePathURL to ocidFilePathURL's URLByDeletingPathExtension()
set strExtensionName to ocidFilePathURL's pathExtension() as text
set strBaseFileName to ocidBaseFilePathURL's lastPathComponent() as text
#保存先
set strSaveFileName to (strBaseFileName & "@縦書き." & strExtensionName) as text
set ocidSaveFilePathURL to ocidContainerDirPathURL's URLByAppendingPathComponent:(strSaveFileName)

##############################################
## XML関連
##############################################
####テキストで読み込み
set listReadDataString to refMe's NSString's stringWithContentsOfURL:ocidFilePathURL encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
#####データ部
set ocidReadString to item 1 of listReadDataString
####エラー部
set ocidNSErrorData to item 2 of listReadDataString
if ocidNSErrorData is not (missing value) then
doGetErrorData(ocidNSErrorData)
end if
#####XML定義
set listReadXML to refMe's NSXMLDocument's alloc()'s initWithXMLString:ocidReadString options:(refMe's NSXMLNodePreserveWhitespace) |error|:(reference)
#####データ部
set ocidReadXML to item 1 of listReadXML
####エラー部
set ocidNSErrorData to item 2 of listReadXML
if ocidNSErrorData is not (missing value) then
doGetErrorData(ocidNSErrorData)
end if
################################
####ROOTエレメント
set ocidRootElement to ocidReadXML's rootElement()
####################
#####headエレメント
set ocidHeadElement to ocidRootElement's childAtIndex:0
#####stylingエレメント
set ocidStylingElement to ocidHeadElement's childAtIndex:0
#####layoutエレメント
set ocidLayoutElement to ocidHeadElement's childAtIndex:1
set ocidRegionElement to ocidLayoutElement's childAtIndex:0
#origin変更
ocidRegionElement's removeAttributeForName:("tts:origin")
set ocidAddNode to refMe's NSXMLNode's attributeWithName:("tts:origin") stringValue:("100% 20%")
ocidRegionElement's addAttribute:(ocidAddNode)
#extent変更
ocidRegionElement's removeAttributeForName:("tts:extent")
set ocidAddNode to refMe's NSXMLNode's attributeWithName:("tts:extent") stringValue:("45% 55%")
ocidRegionElement's addAttribute:(ocidAddNode)
####################
#####Bodyエレメント
set ocidBodyElement to ocidRootElement's childAtIndex:1
#####Bodyに2要素-->複数レイアウトある場合は停止
set numCntDiv to ocidBodyElement's childCount() as number
if numCntDiv > 1 then
return "処理停止 複数レイアウト非対応"
end if
##############################################
## R0データ取得
##############################################
###縦書き置換レコード取得
set ocidH2VDict to doGetH2VDict()
##検索キー
set ocidKeyArray to ocidH2VDict's allKeys()
##キーの数
set numCntKeyArray to ocidKeyArray's |count|() as integer

#####BODYのR0エレメント
set ocidR0Element to ocidBodyElement's childAtIndex:0
#####R0に何行あるか
log ocidR0Element's childCount() as number
##P要素
set ocidR0ChildArray to ocidR0Element's children()
##改行
set ocidBR to refMe's NSString's stringWithString:("<br>")
##Pのテキストの値の数だけ繰り返し
repeat with itemR0Array in ocidR0ChildArray
  #
  set ocidStringValue to itemR0Array's stringValue
  ##各行に対して全キー対象で検索置換
  repeat with itemIntNo from 0 to (numCntKeyArray - 1) by 1
    ##キーを取り出して
    set ocidItemKey to (ocidKeyArray's objectAtIndex:(itemIntNo))
    ##置換用の値を取り出して
    set ocidValue to (ocidH2VDict's valueForKey:(ocidItemKey))
    ##置換する
    set ocidConvertedLine to (ocidStringValue's stringByReplacingOccurrencesOfString:(ocidItemKey) withString:(ocidValue))
    ##次のキー用の置換したテキストに置き換え
    set ocidLineText to ocidConvertedLine
  end repeat
  
  
  
  ##出力(再セット用)の文字列
  set ocidSetStringM to (refMe's NSMutableString's alloc()'s initWithCapacity:(0))
  
  set numCntString to ocidLineText's |length| as integer
  repeat with itemChar from 0 to (numCntString - 1) by 1
    set ocidSetRange to (refMe's NSMakeRange(itemChar, 1))
    set ocidSubString to (ocidLineText's substringWithRange:(ocidSetRange))
(ocidSetStringM's appendString:(ocidSubString))
(ocidSetStringM's appendString:(ocidBR))
  end repeat
(itemR0Array's setStringValue:(ocidSetStringM))
end repeat
##確認用
(*
repeat with itemR0Array in ocidR0ChildArray
log itemR0Array's stringValue as text
end repeat
*)
set ocidReadXMLStrings to ocidReadXML's XMLString()
##BR置換 youtube等改行の仕様によって置換 これはYoutube用
set ocidSaveStrings to (ocidReadXMLStrings's stringByReplacingOccurrencesOfString:("&lt;br&gt;") withString:("<br />"))
set ocidSaveStrings to (ocidSaveStrings's stringByReplacingOccurrencesOfString:("<br /></p>") withString:("</p>"))
set listDone to ocidSaveStrings's writeToURL:(ocidSaveFilePathURL) atomically:true encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)


return


##############################################
## エラー発生時のログ用
##############################################


to doGetErrorData(ocidNSErrorData)
  #####個別のエラー情報
log "エラーコード:" & ocidNSErrorData's code() as text
log "エラードメイン:" & ocidNSErrorData's domain() as text
log "Description:" & ocidNSErrorData's localizedDescription() as text
log "FailureReason:" & ocidNSErrorData's localizedFailureReason() as text
log ocidNSErrorData's localizedRecoverySuggestion() as text
log ocidNSErrorData's localizedRecoveryOptions() as text
log ocidNSErrorData's recoveryAttempter() as text
log ocidNSErrorData's helpAnchor() as text
  set ocidNSErrorUserInfo to ocidNSErrorData's userInfo()
  set ocidAllValues to ocidNSErrorUserInfo's allValues() as list
  set ocidAllKeys to ocidNSErrorUserInfo's allKeys() as list
  repeat with ocidKeys in ocidAllKeys
    if (ocidKeys as text) is "NSUnderlyingError" then
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedDescription() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedFailureReason() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedRecoverySuggestion() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s localizedRecoveryOptions() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s recoveryAttempter() as text
log (ocidNSErrorUserInfo's valueForKey:ocidKeys)'s helpAnchor() as text
    else
      ####それ以外の値はそのままテキストで読める
log (ocidKeys as text) & ": " & (ocidNSErrorUserInfo's valueForKey:ocidKeys) as text
    end if
  end repeat
  
end doGetErrorData




###############
###置換レコード
###############
to doGetH2VDict()
  
  set ocidH2VDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidH2VDict's setValue:("︱") forKey:("ー")
ocidH2VDict's setValue:("︲") forKey:("-")
ocidH2VDict's setValue:("︵") forKey:("(")
ocidH2VDict's setValue:("︶") forKey:(")")
ocidH2VDict's setValue:("︷") forKey:("{")
ocidH2VDict's setValue:("︸") forKey:("}")
ocidH2VDict's setValue:("︹") forKey:("〔")
ocidH2VDict's setValue:("︺") forKey:("〕")
ocidH2VDict's setValue:("︻") forKey:("【")
ocidH2VDict's setValue:("︼") forKey:("】")
ocidH2VDict's setValue:("︗") forKey:("〖")
ocidH2VDict's setValue:("︘") forKey:("〗")
ocidH2VDict's setValue:("︽") forKey:("⟪")
ocidH2VDict's setValue:("︾") forKey:("⟫")
ocidH2VDict's setValue:("︽") forKey:("«")
ocidH2VDict's setValue:("︾") forKey:("»")
ocidH2VDict's setValue:("︽") forKey:("《")
ocidH2VDict's setValue:("︾") forKey:("》")
ocidH2VDict's setValue:("︿") forKey:("<")
ocidH2VDict's setValue:("﹀") forKey:(">")
ocidH2VDict's setValue:("︿") forKey:("‹")
ocidH2VDict's setValue:("﹀") forKey:("›")
ocidH2VDict's setValue:("︿") forKey:("〈")
ocidH2VDict's setValue:("﹀") forKey:("〉")
ocidH2VDict's setValue:("︿") forKey:("⟨")
ocidH2VDict's setValue:("﹀") forKey:("⟩")
ocidH2VDict's setValue:("︿") forKey:("<")
ocidH2VDict's setValue:("﹀") forKey:(">")
ocidH2VDict's setValue:("︿") forKey:("❮")
ocidH2VDict's setValue:("﹀") forKey:("❯")
ocidH2VDict's setValue:("︿") forKey:("❬")
ocidH2VDict's setValue:("﹀") forKey:("❭")
ocidH2VDict's setValue:("︿") forKey:("❰")
ocidH2VDict's setValue:("﹀") forKey:("❱")
ocidH2VDict's setValue:("﹁") forKey:("「")
ocidH2VDict's setValue:("﹂") forKey:("」")
ocidH2VDict's setValue:("﹁") forKey:("⎡")
ocidH2VDict's setValue:("﹂") forKey:("⎦")
ocidH2VDict's setValue:("﹃") forKey:("『")
ocidH2VDict's setValue:("﹄") forKey:("』")
ocidH2VDict's setValue:("﹇") forKey:("[")
ocidH2VDict's setValue:("﹈") forKey:("]")
ocidH2VDict's setValue:("﹇") forKey:("[")
ocidH2VDict's setValue:("﹈") forKey:("]")
ocidH2VDict's setValue:("﹇") forKey:("[")
ocidH2VDict's setValue:("﹈") forKey:("]")
ocidH2VDict's setValue:("﹇") forKey:("⟦")
ocidH2VDict's setValue:("﹈") forKey:("⟧")
ocidH2VDict's setValue:("︐") forKey:("、")
ocidH2VDict's setValue:("︑") forKey:("、")
ocidH2VDict's setValue:("︒") forKey:("。")
ocidH2VDict's setValue:("︓") forKey:(":")
ocidH2VDict's setValue:("︔") forKey:(";")
ocidH2VDict's setValue:("︙") forKey:("…")
ocidH2VDict's setValue:("︕") forKey:("!")
ocidH2VDict's setValue:("︖") forKey:("?")
  
return ocidH2VDict
  
end doGetH2VDict


|

[DaVinci Resolve]縦書き字幕用TTMLにラインセパレーターが混入する

『普通ではない行終端記号が検出されました』
20240418011156508x398
『書類に複数の改行コードが混在しています。』
20240418011211496x360



これは、ラインセパレーター 0x2028
20240418010632_596x538
が混入することで発生します
削除して大丈夫です。
正規表現だと
\t|\n|\r|\u2028とか?で削除しちゃってください

|

[TTML] 縦書き字幕 originとして指定はおおむね8箇所


使ったTTML

<?xml version="1.0" encoding="UTF-8"?>
<tt xml:lang="en" xmlns="http://www.w3.org/ns/ttml" xmlns:ttm="http://www.w3.org/ns/ttml#metadata" xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ttp="http://www.w3.org/ns/ttml#parameter" xmlns:ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter" xmlns:itts="http://www.w3.org/ns/ttml/profile/imsc1#styling" ttp:profile="http://www.w3.org/ns/ttml/profile/imsc1/text" ttp:frameRate="50" ttp:timeBase="media">
<head>
<styling>
<style xml:id="R0S" tts:color="#ffffff" tts:opacity="1" tts:fontSize="100%" tts:fontFamily="proportionalSansSerif" tts:textAlign="center"/>
<style xml:id="RS" tts:displayAlign="center" tts:textAlign="left" tts:color="#ffffff" tts:opacity="1" tts:fontSize="100%" tts:fontFamily="proportionalSansSerif"/>
</styling>
<layout>
<region xml:id="R0" tts:origin="41.730% 58.638%" tts:extent="16.562% 8.241%" tts:displayAlign="center"/>

<region xml:id="R1" tts:displayAlign="center" tts:textAlign="left" tts:origin="0% 0%" tts:extent="10% 100%"/>
<region xml:id="R2" tts:displayAlign="center" tts:textAlign="left" tts:origin="10% 0%" tts:extent="10% 100%"/>
<region xml:id="R3" tts:displayAlign="center" tts:textAlign="left" tts:origin="20% 0%" tts:extent="10% 100%"/>
<region xml:id="R4" tts:displayAlign="center" tts:textAlign="left" tts:origin="30% 0%" tts:extent="10% 100%"/>
<region xml:id="R5" tts:displayAlign="center" tts:textAlign="left" tts:origin="40% 0%" tts:extent="10% 100%"/>
<region xml:id="R6" tts:displayAlign="center" tts:textAlign="left" tts:origin="50% 0%" tts:extent="10% 100%"/>
<region xml:id="R7" tts:displayAlign="center" tts:textAlign="left" tts:origin="60% 0%" tts:extent="10% 100%"/>
<region xml:id="R8" tts:displayAlign="center" tts:textAlign="left" tts:origin="70% 0%" tts:extent="10% 100%"/>
<region xml:id="R9" tts:displayAlign="center" tts:textAlign="left" tts:origin="80% 0%" tts:extent="10% 100%"/>

</layout>
</head>
<body>
<div xml:id="d1" region="R1" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />0<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R2" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />10<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R3" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />20<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R4" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />30<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R5" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />40<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R6" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />50<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R7" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />60<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R8" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />70<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>
<div xml:id="d1" region="R9" style="RS"><p begin="01:00:00.000" end="01:00:40.599">origin<br />80<br />0<br /><br /><br /><br /><br /><br /><br /><br /><br /></p></div>



<div xml:id="d0" region="R0" style="R0_style">
<p begin="01:00:00.000" end="01:00:00.099">0:00:00.0</p>
<p begin="01:00:00.099" end="01:00:00.199">0:00:00.1</p>
<p begin="01:00:00.199" end="01:00:00.300">0:00:00.2</p>
<p begin="01:00:00.300" end="01:00:00.400">0:00:00.3</p>
<p begin="01:00:00.400" end="01:00:00.500">0:00:00.4</p>
<p begin="01:00:00.500" end="01:00:00.599">0:00:00.5</p>
<p begin="01:00:00.599" end="01:00:00.699">0:00:00.6</p>
<p begin="01:00:00.699" end="01:00:00.800">0:00:00.7</p>
<p begin="01:00:00.800" end="01:00:00.900">0:00:00.8</p>
<p begin="01:00:00.900" end="01:00:01.000">0:00:00.9</p>
<p begin="01:00:01.000" end="01:00:01.099">0:00:01.0</p>
<p begin="01:00:01.099" end="01:00:01.199">0:00:01.1</p>
<p begin="01:00:01.199" end="01:00:01.300">0:00:01.2</p>
<p begin="01:00:01.300" end="01:00:01.400">0:00:01.3</p>
<p begin="01:00:01.400" end="01:00:01.500">0:00:01.4</p>
<p begin="01:00:01.500" end="01:00:01.599">0:00:01.5</p>
<p begin="01:00:01.599" end="01:00:01.699">0:00:01.6</p>
<p begin="01:00:01.699" end="01:00:01.800">0:00:01.7</p>
<p begin="01:00:01.800" end="01:00:01.900">0:00:01.8</p>
<p begin="01:00:01.900" end="01:00:02.000">0:00:01.9</p>
<p begin="01:00:02.000" end="01:00:02.099">0:00:02.0</p>
<p begin="01:00:02.099" end="01:00:02.199">0:00:02.1</p>
<p begin="01:00:02.199" end="01:00:02.300">0:00:02.2</p>
<p begin="01:00:02.300" end="01:00:02.400">0:00:02.3</p>
<p begin="01:00:02.400" end="01:00:02.500">0:00:02.4</p>
<p begin="01:00:02.500" end="01:00:02.599">0:00:02.5</p>
<p begin="01:00:02.599" end="01:00:02.699">0:00:02.6</p>
<p begin="01:00:02.699" end="01:00:02.800">0:00:02.7</p>
<p begin="01:00:02.800" end="01:00:02.900">0:00:02.8</p>
<p begin="01:00:02.900" end="01:00:03.000">0:00:02.9</p>
<p begin="01:00:03.000" end="01:00:03.099">0:00:03.0</p>
<p begin="01:00:03.099" end="01:00:03.199">0:00:03.1</p>
<p begin="01:00:03.199" end="01:00:03.300">0:00:03.2</p>
<p begin="01:00:03.300" end="01:00:03.400">0:00:03.3</p>
<p begin="01:00:03.400" end="01:00:03.500">0:00:03.4</p>
<p begin="01:00:03.500" end="01:00:03.599">0:00:03.5</p>
<p begin="01:00:03.599" end="01:00:03.699">0:00:03.6</p>
<p begin="01:00:03.699" end="01:00:03.800">0:00:03.7</p>
<p begin="01:00:03.800" end="01:00:03.900">0:00:03.8</p>
<p begin="01:00:03.900" end="01:00:04.000">0:00:03.9</p>
<p begin="01:00:04.000" end="01:00:04.099">0:00:04.0</p>
<p begin="01:00:04.099" end="01:00:04.199">0:00:04.1</p>
<p begin="01:00:04.199" end="01:00:04.300">0:00:04.2</p>
<p begin="01:00:04.300" end="01:00:04.400">0:00:04.3</p>
<p begin="01:00:04.400" end="01:00:04.500">0:00:04.4</p>
<p begin="01:00:04.500" end="01:00:04.599">0:00:04.5</p>
<p begin="01:00:04.599" end="01:00:04.699">0:00:04.6</p>
<p begin="01:00:04.699" end="01:00:04.800">0:00:04.7</p>
<p begin="01:00:04.800" end="01:00:04.900">0:00:04.8</p>
<p begin="01:00:04.900" end="01:00:05.000">0:00:04.9</p>
<p begin="01:00:05.000" end="01:00:05.099">0:00:05.0</p>
<p begin="01:00:05.099" end="01:00:05.199">0:00:05.1</p>
<p begin="01:00:05.199" end="01:00:05.300">0:00:05.2</p>
<p begin="01:00:05.300" end="01:00:05.400">0:00:05.3</p>
<p begin="01:00:05.400" end="01:00:05.500">0:00:05.4</p>
<p begin="01:00:05.500" end="01:00:05.599">0:00:05.5</p>
<p begin="01:00:05.599" end="01:00:05.699">0:00:05.6</p>
<p begin="01:00:05.699" end="01:00:05.800">0:00:05.7</p>
<p begin="01:00:05.800" end="01:00:05.900">0:00:05.8</p>
<p begin="01:00:05.900" end="01:00:06.000">0:00:05.9</p>
<p begin="01:00:06.000" end="01:00:06.099">0:00:06.0</p>
<p begin="01:00:06.099" end="01:00:06.199">0:00:06.1</p>
<p begin="01:00:06.199" end="01:00:06.300">0:00:06.2</p>
<p begin="01:00:06.300" end="01:00:06.400">0:00:06.3</p>
<p begin="01:00:06.400" end="01:00:06.500">0:00:06.4</p>
<p begin="01:00:06.500" end="01:00:06.599">0:00:06.5</p>
<p begin="01:00:06.599" end="01:00:06.699">0:00:06.6</p>
<p begin="01:00:06.699" end="01:00:06.800">0:00:06.7</p>
<p begin="01:00:06.800" end="01:00:06.900">0:00:06.8</p>
<p begin="01:00:06.900" end="01:00:07.000">0:00:06.9</p>
<p begin="01:00:07.000" end="01:00:07.099">0:00:07.0</p>
<p begin="01:00:07.099" end="01:00:07.199">0:00:07.1</p>
<p begin="01:00:07.199" end="01:00:07.300">0:00:07.2</p>
<p begin="01:00:07.300" end="01:00:07.400">0:00:07.3</p>
<p begin="01:00:07.400" end="01:00:07.500">0:00:07.4</p>
<p begin="01:00:07.500" end="01:00:07.599">0:00:07.5</p>
<p begin="01:00:07.599" end="01:00:07.699">0:00:07.6</p>
<p begin="01:00:07.699" end="01:00:07.800">0:00:07.7</p>
<p begin="01:00:07.800" end="01:00:07.900">0:00:07.8</p>
<p begin="01:00:07.900" end="01:00:08.000">0:00:07.9</p>
<p begin="01:00:08.000" end="01:00:08.099">0:00:08.0</p>
<p begin="01:00:08.099" end="01:00:08.199">0:00:08.1</p>
<p begin="01:00:08.199" end="01:00:08.300">0:00:08.2</p>
<p begin="01:00:08.300" end="01:00:08.400">0:00:08.3</p>
<p begin="01:00:08.400" end="01:00:08.500">0:00:08.4</p>
<p begin="01:00:08.500" end="01:00:08.599">0:00:08.5</p>
<p begin="01:00:08.599" end="01:00:08.699">0:00:08.6</p>
<p begin="01:00:08.699" end="01:00:08.800">0:00:08.7</p>
<p begin="01:00:08.800" end="01:00:08.900">0:00:08.8</p>
<p begin="01:00:08.900" end="01:00:09.000">0:00:08.9</p>
<p begin="01:00:09.000" end="01:00:09.099">0:00:09.0</p>
<p begin="01:00:09.099" end="01:00:09.199">0:00:09.1</p>
<p begin="01:00:09.199" end="01:00:09.300">0:00:09.2</p>
<p begin="01:00:09.300" end="01:00:09.400">0:00:09.3</p>
<p begin="01:00:09.400" end="01:00:09.500">0:00:09.4</p>
<p begin="01:00:09.500" end="01:00:09.599">0:00:09.5</p>
<p begin="01:00:09.599" end="01:00:09.699">0:00:09.6</p>
<p begin="01:00:09.699" end="01:00:09.800">0:00:09.7</p>
<p begin="01:00:09.800" end="01:00:09.900">0:00:09.8</p>
<p begin="01:00:09.900" end="01:00:10.000">0:00:09.9</p>
<p begin="01:00:10.000" end="01:00:10.099">0:00:10.0</p>
<p begin="01:00:10.099" end="01:00:10.199">0:00:10.1</p>
<p begin="01:00:10.199" end="01:00:10.300">0:00:10.2</p>
<p begin="01:00:10.300" end="01:00:10.400">0:00:10.3</p>
<p begin="01:00:10.400" end="01:00:10.500">0:00:10.4</p>
<p begin="01:00:10.500" end="01:00:10.599">0:00:10.5</p>
<p begin="01:00:10.599" end="01:00:10.699">0:00:10.6</p>
<p begin="01:00:10.699" end="01:00:10.800">0:00:10.7</p>
<p begin="01:00:10.800" end="01:00:10.900">0:00:10.8</p>
<p begin="01:00:10.900" end="01:00:11.000">0:00:10.9</p>
<p begin="01:00:11.000" end="01:00:11.099">0:00:11.0</p>
<p begin="01:00:11.099" end="01:00:11.199">0:00:11.1</p>
<p begin="01:00:11.199" end="01:00:11.300">0:00:11.2</p>
<p begin="01:00:11.300" end="01:00:11.400">0:00:11.3</p>
<p begin="01:00:11.400" end="01:00:11.500">0:00:11.4</p>
<p begin="01:00:11.500" end="01:00:11.599">0:00:11.5</p>
<p begin="01:00:11.599" end="01:00:11.699">0:00:11.6</p>
<p begin="01:00:11.699" end="01:00:11.800">0:00:11.7</p>
<p begin="01:00:11.800" end="01:00:11.900">0:00:11.8</p>
<p begin="01:00:11.900" end="01:00:12.000">0:00:11.9</p>
<p begin="01:00:12.000" end="01:00:12.099">0:00:12.0</p>
<p begin="01:00:12.099" end="01:00:12.199">0:00:12.1</p>
<p begin="01:00:12.199" end="01:00:12.300">0:00:12.2</p>
<p begin="01:00:12.300" end="01:00:12.400">0:00:12.3</p>
<p begin="01:00:12.400" end="01:00:12.500">0:00:12.4</p>
<p begin="01:00:12.500" end="01:00:12.599">0:00:12.5</p>
<p begin="01:00:12.599" end="01:00:12.699">0:00:12.6</p>
<p begin="01:00:12.699" end="01:00:12.800">0:00:12.7</p>
<p begin="01:00:12.800" end="01:00:12.900">0:00:12.8</p>
<p begin="01:00:12.900" end="01:00:13.000">0:00:12.9</p>
<p begin="01:00:13.000" end="01:00:13.099">0:00:13.0</p>
<p begin="01:00:13.099" end="01:00:13.199">0:00:13.1</p>
<p begin="01:00:13.199" end="01:00:13.300">0:00:13.2</p>
<p begin="01:00:13.300" end="01:00:13.400">0:00:13.3</p>
<p begin="01:00:13.400" end="01:00:13.500">0:00:13.4</p>
<p begin="01:00:13.500" end="01:00:13.599">0:00:13.5</p>
<p begin="01:00:13.599" end="01:00:13.699">0:00:13.6</p>
<p begin="01:00:13.699" end="01:00:13.800">0:00:13.7</p>
<p begin="01:00:13.800" end="01:00:13.900">0:00:13.8</p>
<p begin="01:00:13.900" end="01:00:14.000">0:00:13.9</p>
<p begin="01:00:14.000" end="01:00:14.099">0:00:14.0</p>
<p begin="01:00:14.099" end="01:00:14.199">0:00:14.1</p>
<p begin="01:00:14.199" end="01:00:14.300">0:00:14.2</p>
<p begin="01:00:14.300" end="01:00:14.400">0:00:14.3</p>
<p begin="01:00:14.400" end="01:00:14.500">0:00:14.4</p>
<p begin="01:00:14.500" end="01:00:14.599">0:00:14.5</p>
<p begin="01:00:14.599" end="01:00:14.699">0:00:14.6</p>
<p begin="01:00:14.699" end="01:00:14.800">0:00:14.7</p>
<p begin="01:00:14.800" end="01:00:14.900">0:00:14.8</p>
<p begin="01:00:14.900" end="01:00:15.000">0:00:14.9</p>
<p begin="01:00:15.000" end="01:00:15.099">0:00:15.0</p>
<p begin="01:00:15.099" end="01:00:15.199">0:00:15.1</p>
<p begin="01:00:15.199" end="01:00:15.300">0:00:15.2</p>
<p begin="01:00:15.300" end="01:00:15.400">0:00:15.3</p>
<p begin="01:00:15.400" end="01:00:15.500">0:00:15.4</p>
<p begin="01:00:15.500" end="01:00:15.599">0:00:15.5</p>
<p begin="01:00:15.599" end="01:00:15.699">0:00:15.6</p>
<p begin="01:00:15.699" end="01:00:15.800">0:00:15.7</p>
<p begin="01:00:15.800" end="01:00:15.900">0:00:15.8</p>
<p begin="01:00:15.900" end="01:00:16.000">0:00:15.9</p>
<p begin="01:00:16.000" end="01:00:16.099">0:00:16.0</p>
<p begin="01:00:16.099" end="01:00:16.199">0:00:16.1</p>
<p begin="01:00:16.199" end="01:00:16.300">0:00:16.2</p>
<p begin="01:00:16.300" end="01:00:16.400">0:00:16.3</p>
<p begin="01:00:16.400" end="01:00:16.500">0:00:16.4</p>
<p begin="01:00:16.500" end="01:00:16.599">0:00:16.5</p>
<p begin="01:00:16.599" end="01:00:16.699">0:00:16.6</p>
<p begin="01:00:16.699" end="01:00:16.800">0:00:16.7</p>
<p begin="01:00:16.800" end="01:00:16.900">0:00:16.8</p>
<p begin="01:00:16.900" end="01:00:17.000">0:00:16.9</p>
<p begin="01:00:17.000" end="01:00:17.099">0:00:17.0</p>
<p begin="01:00:17.099" end="01:00:17.199">0:00:17.1</p>
<p begin="01:00:17.199" end="01:00:17.300">0:00:17.2</p>
<p begin="01:00:17.300" end="01:00:17.400">0:00:17.3</p>
<p begin="01:00:17.400" end="01:00:17.500">0:00:17.4</p>
<p begin="01:00:17.500" end="01:00:17.599">0:00:17.5</p>
<p begin="01:00:17.599" end="01:00:17.699">0:00:17.6</p>
<p begin="01:00:17.699" end="01:00:17.800">0:00:17.7</p>
<p begin="01:00:17.800" end="01:00:17.900">0:00:17.8</p>
<p begin="01:00:17.900" end="01:00:18.000">0:00:17.9</p>
<p begin="01:00:18.000" end="01:00:18.099">0:00:18.0</p>
<p begin="01:00:18.099" end="01:00:18.199">0:00:18.1</p>
<p begin="01:00:18.199" end="01:00:18.300">0:00:18.2</p>
<p begin="01:00:18.300" end="01:00:18.400">0:00:18.3</p>
<p begin="01:00:18.400" end="01:00:18.500">0:00:18.4</p>
<p begin="01:00:18.500" end="01:00:18.599">0:00:18.5</p>
<p begin="01:00:18.599" end="01:00:18.699">0:00:18.6</p>
<p begin="01:00:18.699" end="01:00:18.800">0:00:18.7</p>
<p begin="01:00:18.800" end="01:00:18.900">0:00:18.8</p>
<p begin="01:00:18.900" end="01:00:19.000">0:00:18.9</p>
<p begin="01:00:19.000" end="01:00:19.099">0:00:19.0</p>
<p begin="01:00:19.099" end="01:00:19.199">0:00:19.1</p>
<p begin="01:00:19.199" end="01:00:19.300">0:00:19.2</p>
<p begin="01:00:19.300" end="01:00:19.400">0:00:19.3</p>
<p begin="01:00:19.400" end="01:00:19.500">0:00:19.4</p>
<p begin="01:00:19.500" end="01:00:19.599">0:00:19.5</p>
<p begin="01:00:19.599" end="01:00:19.699">0:00:19.6</p>
<p begin="01:00:19.699" end="01:00:19.800">0:00:19.7</p>
<p begin="01:00:19.800" end="01:00:19.900">0:00:19.8</p>
<p begin="01:00:19.900" end="01:00:20.000">0:00:19.9</p>
<p begin="01:00:20.000" end="01:00:20.099">0:00:20.0</p>
<p begin="01:00:20.099" end="01:00:20.199">0:00:20.1</p>
<p begin="01:00:20.199" end="01:00:20.300">0:00:20.2</p>
<p begin="01:00:20.300" end="01:00:20.400">0:00:20.3</p>
<p begin="01:00:20.400" end="01:00:20.500">0:00:20.4</p>
<p begin="01:00:20.500" end="01:00:20.599">0:00:20.5</p>
<p begin="01:00:20.599" end="01:00:20.699">0:00:20.6</p>
<p begin="01:00:20.699" end="01:00:20.800">0:00:20.7</p>
<p begin="01:00:20.800" end="01:00:20.900">0:00:20.8</p>
<p begin="01:00:20.900" end="01:00:21.000">0:00:20.9</p>
<p begin="01:00:21.000" end="01:00:21.099">0:00:21.0</p>
<p begin="01:00:21.099" end="01:00:21.199">0:00:21.1</p>
<p begin="01:00:21.199" end="01:00:21.300">0:00:21.2</p>
<p begin="01:00:21.300" end="01:00:21.400">0:00:21.3</p>
<p begin="01:00:21.400" end="01:00:21.500">0:00:21.4</p>
<p begin="01:00:21.500" end="01:00:21.599">0:00:21.5</p>
<p begin="01:00:21.599" end="01:00:21.699">0:00:21.6</p>
<p begin="01:00:21.699" end="01:00:21.800">0:00:21.7</p>
<p begin="01:00:21.800" end="01:00:21.900">0:00:21.8</p>
<p begin="01:00:21.900" end="01:00:22.000">0:00:21.9</p>
<p begin="01:00:22.000" end="01:00:22.099">0:00:22.0</p>
<p begin="01:00:22.099" end="01:00:22.199">0:00:22.1</p>
<p begin="01:00:22.199" end="01:00:22.300">0:00:22.2</p>
<p begin="01:00:22.300" end="01:00:22.400">0:00:22.3</p>
<p begin="01:00:22.400" end="01:00:22.500">0:00:22.4</p>
<p begin="01:00:22.500" end="01:00:22.599">0:00:22.5</p>
<p begin="01:00:22.599" end="01:00:22.699">0:00:22.6</p>
<p begin="01:00:22.699" end="01:00:22.800">0:00:22.7</p>
<p begin="01:00:22.800" end="01:00:22.900">0:00:22.8</p>
<p begin="01:00:22.900" end="01:00:23.000">0:00:22.9</p>
<p begin="01:00:23.000" end="01:00:23.099">0:00:23.0</p>
<p begin="01:00:23.099" end="01:00:23.199">0:00:23.1</p>
<p begin="01:00:23.199" end="01:00:23.300">0:00:23.2</p>
<p begin="01:00:23.300" end="01:00:23.400">0:00:23.3</p>
<p begin="01:00:23.400" end="01:00:23.500">0:00:23.4</p>
<p begin="01:00:23.500" end="01:00:23.599">0:00:23.5</p>
<p begin="01:00:23.599" end="01:00:23.699">0:00:23.6</p>
<p begin="01:00:23.699" end="01:00:23.800">0:00:23.7</p>
<p begin="01:00:23.800" end="01:00:23.900">0:00:23.8</p>
<p begin="01:00:23.900" end="01:00:24.000">0:00:23.9</p>
<p begin="01:00:24.000" end="01:00:24.099">0:00:24.0</p>
<p begin="01:00:24.099" end="01:00:24.199">0:00:24.1</p>
<p begin="01:00:24.199" end="01:00:24.300">0:00:24.2</p>
<p begin="01:00:24.300" end="01:00:24.400">0:00:24.3</p>
<p begin="01:00:24.400" end="01:00:24.500">0:00:24.4</p>
<p begin="01:00:24.500" end="01:00:24.599">0:00:24.5</p>
<p begin="01:00:24.599" end="01:00:24.699">0:00:24.6</p>
<p begin="01:00:24.699" end="01:00:24.800">0:00:24.7</p>
<p begin="01:00:24.800" end="01:00:24.900">0:00:24.8</p>
<p begin="01:00:24.900" end="01:00:25.000">0:00:24.9</p>
<p begin="01:00:25.000" end="01:00:25.099">0:00:25.0</p>
<p begin="01:00:25.099" end="01:00:25.199">0:00:25.1</p>
<p begin="01:00:25.199" end="01:00:25.300">0:00:25.2</p>
<p begin="01:00:25.300" end="01:00:25.400">0:00:25.3</p>
<p begin="01:00:25.400" end="01:00:25.500">0:00:25.4</p>
<p begin="01:00:25.500" end="01:00:25.599">0:00:25.5</p>
<p begin="01:00:25.599" end="01:00:25.699">0:00:25.6</p>
<p begin="01:00:25.699" end="01:00:25.800">0:00:25.7</p>
<p begin="01:00:25.800" end="01:00:25.900">0:00:25.8</p>
<p begin="01:00:25.900" end="01:00:26.000">0:00:25.9</p>
<p begin="01:00:26.000" end="01:00:26.099">0:00:26.0</p>
<p begin="01:00:26.099" end="01:00:26.199">0:00:26.1</p>
<p begin="01:00:26.199" end="01:00:26.300">0:00:26.2</p>
<p begin="01:00:26.300" end="01:00:26.400">0:00:26.3</p>
<p begin="01:00:26.400" end="01:00:26.500">0:00:26.4</p>
<p begin="01:00:26.500" end="01:00:26.599">0:00:26.5</p>
<p begin="01:00:26.599" end="01:00:26.699">0:00:26.6</p>
<p begin="01:00:26.699" end="01:00:26.800">0:00:26.7</p>
<p begin="01:00:26.800" end="01:00:26.900">0:00:26.8</p>
<p begin="01:00:26.900" end="01:00:27.000">0:00:26.9</p>
<p begin="01:00:27.000" end="01:00:27.099">0:00:27.0</p>
<p begin="01:00:27.099" end="01:00:27.199">0:00:27.1</p>
<p begin="01:00:27.199" end="01:00:27.300">0:00:27.2</p>
<p begin="01:00:27.300" end="01:00:27.400">0:00:27.3</p>
<p begin="01:00:27.400" end="01:00:27.500">0:00:27.4</p>
<p begin="01:00:27.500" end="01:00:27.599">0:00:27.5</p>
<p begin="01:00:27.599" end="01:00:27.699">0:00:27.6</p>
<p begin="01:00:27.699" end="01:00:27.800">0:00:27.7</p>
<p begin="01:00:27.800" end="01:00:27.900">0:00:27.8</p>
<p begin="01:00:27.900" end="01:00:28.000">0:00:27.9</p>
<p begin="01:00:28.000" end="01:00:28.099">0:00:28.0</p>
<p begin="01:00:28.099" end="01:00:28.199">0:00:28.1</p>
<p begin="01:00:28.199" end="01:00:28.300">0:00:28.2</p>
<p begin="01:00:28.300" end="01:00:28.400">0:00:28.3</p>
<p begin="01:00:28.400" end="01:00:28.500">0:00:28.4</p>
<p begin="01:00:28.500" end="01:00:28.599">0:00:28.5</p>
<p begin="01:00:28.599" end="01:00:28.699">0:00:28.6</p>
<p begin="01:00:28.699" end="01:00:28.800">0:00:28.7</p>
<p begin="01:00:28.800" end="01:00:28.900">0:00:28.8</p>
<p begin="01:00:28.900" end="01:00:29.000">0:00:28.9</p>
<p begin="01:00:29.000" end="01:00:29.099">0:00:29.0</p>
<p begin="01:00:29.099" end="01:00:29.199">0:00:29.1</p>
<p begin="01:00:29.199" end="01:00:29.300">0:00:29.2</p>
<p begin="01:00:29.300" end="01:00:29.400">0:00:29.3</p>
<p begin="01:00:29.400" end="01:00:29.500">0:00:29.4</p>
<p begin="01:00:29.500" end="01:00:29.599">0:00:29.5</p>
<p begin="01:00:29.599" end="01:00:29.699">0:00:29.6</p>
<p begin="01:00:29.699" end="01:00:29.800">0:00:29.7</p>
<p begin="01:00:29.800" end="01:00:29.900">0:00:29.8</p>
<p begin="01:00:29.900" end="01:00:30.000">0:00:29.9</p>
</div>

</body>
</tt>


|

[TTML]現時点でのまとめ(自分用)更新

Timed Text Markup Language 1 (TTML1) - W3C
https://www.w3.org/TR/2018/REC-ttml1-20181108/
Timed Text Markup Language 2 (TTML2) - W3C
https://www.w3.org/TR/2018/REC-ttml2-20181108/



iTT (iTunes Timed Text)
iTunes Video and Audio Asset Guide 5.3.12 
Lyrics Example Annotations
[TTML] TTMLファイルにiTT (iTunes Timed Text)の要素の付与
https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-dc3854.html


TTML関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053036/index.html
LRC関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053331/index.html
SRT関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053335/index.html
FFMETADATA1
https://quicktimer.cocolog-nifty.com/icefloe/2023/04/post-dd127e.html
[TTML]編集にはVisual Studio Codeと機能拡張がベター
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-bf9686.html


Mac表示
Screen-20230112-120243

モバイル表示
Screen-20230112-120429



JEDIT用カラーリングファイル

ダウンロード - ttml_coloring.plist




【留意】
R0-R2等上部に設定すると、iPhone等のカメラの出っ張りに隠れてしまう表示がある
なので
意図したポジションにCCを出したい場合は
R4からR10ぐらいが確実かもしれない
通常の1行の場合はR14にしておけば良いのか?な?


ポジションサンプル(現時点)
留意:displayAlignはafterで換算しています
extentを0%設定しているのは、値を入れると『現時点で』意図する表示にならないので0%にしていますが、本来は文字のサイズに対応して5%ぐらいを指定するのが良いのかも?しれない

    <layout>

      <region xml:id="R0" tts:origin="0.000% 5%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R1" tts:origin="0.000% 19%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R2" tts:origin="0.000% 25%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R3" tts:origin="0.000% 29%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R4" tts:origin="0.000% 34%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R5" tts:origin="0.000% 40%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R6" tts:origin="0.000% 45%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R7" tts:origin="0.000% 50%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R8" tts:origin="0.000% 56%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R9" tts:origin="0.000% 61%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R10" tts:origin="0.000% 67%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R11" tts:origin="0.000% 72%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R12" tts:origin="0.000% 80%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R13" tts:origin="0.000% 86%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R14" tts:origin="0.000% 95%" tts:extent="100.000% 0%" tts:displayAlign="after" />

    </layout>


ツール類 基本XMLなので
Visual Studio Code
https://code.visualstudio.com/
Visual Studio Code用機能拡張 
XML Tools
https://marketplace.visualstudio.com/items?itemName=DotJoshJohnson.xml
Red HatのXMLはソースの閲覧には良いが 編集には向かない(執筆時点)
https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml

ツール類
ssa2srt
https://strawberrysw.com/ssa2srt/
Screen-5
ツール類
Jubler Subtitle Εditor
https://www.jubler.org
Jublerscreenshotwebp
記事発行時点でYoutubeではlayout内にstyleを記述すると
一部の属性で無視される
202404130147371536x1092
ポジショニングについてのメモ Ttml0011920x1080Ttml0021920x1080Ttml0031920x1080Ttml0041920x1080Ttml0051920x1080Ttml0061920x1080
縦書き置換用正規表現
([\p{Hiragana}\p{Katakana}\p{Han}])
\1<br />

202404150249351002x736

|

[TTML]現時点でのまとめ(自分用)

Timed Text Markup Language 1 (TTML1) - W3C
https://www.w3.org/TR/2018/REC-ttml1-20181108/
Timed Text Markup Language 2 (TTML2) - W3C
https://www.w3.org/TR/2018/REC-ttml2-20181108/



iTT (iTunes Timed Text)
iTunes Video and Audio Asset Guide 5.3.12 
Lyrics Example Annotations
[TTML] TTMLファイルにiTT (iTunes Timed Text)の要素の付与
https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-dc3854.html


TTML関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053036/index.html
LRC関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053331/index.html
SRT関連
https://quicktimer.cocolog-nifty.com/icefloe/cat76053335/index.html
FFMETADATA1
https://quicktimer.cocolog-nifty.com/icefloe/2023/04/post-dd127e.html
[TTML]編集にはVisual Studio Codeと機能拡張がベター
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-bf9686.html


Mac表示
Screen-20230112-120243

モバイル表示
Screen-20230112-120429



JEDIT用カラーリングファイル

ダウンロード - ttml_coloring.plist




【留意】
R0-R2等上部に設定すると、iPhone等のカメラの出っ張りに隠れてしまう表示がある
なので
意図したポジションにCCを出したい場合は
R4からR10ぐらいが確実かもしれない
通常の1行の場合はR14にしておけば良いのか?な?


ポジションサンプル(現時点)
留意:displayAlignはafterで換算しています
extentを0%設定しているのは、値を入れると『現時点で』意図する表示にならないので0%にしていますが、本来は文字のサイズに対応して5%ぐらいを指定するのが良いのかも?しれない

    <layout>

      <region xml:id="R0" tts:origin="0.000% 5%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R1" tts:origin="0.000% 19%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R2" tts:origin="0.000% 25%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R3" tts:origin="0.000% 29%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R4" tts:origin="0.000% 34%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R5" tts:origin="0.000% 40%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R6" tts:origin="0.000% 45%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R7" tts:origin="0.000% 50%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R8" tts:origin="0.000% 56%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R9" tts:origin="0.000% 61%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R10" tts:origin="0.000% 67%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R11" tts:origin="0.000% 72%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R12" tts:origin="0.000% 80%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R13" tts:origin="0.000% 86%" tts:extent="100.000% 0%" tts:displayAlign="after" />

      <region xml:id="R14" tts:origin="0.000% 95%" tts:extent="100.000% 0%" tts:displayAlign="after" />

    </layout>


ツール類 基本XMLなので
Visual Studio Code
https://code.visualstudio.com/
Visual Studio Code用機能拡張 
XML Tools
https://marketplace.visualstudio.com/items?itemName=DotJoshJohnson.xml
Red HatのXMLはソースの閲覧には良いが 編集には向かない(執筆時点)
https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml

ツール類
ssa2srt
https://strawberrysw.com/ssa2srt/
Screen-5
ツール類
Jubler Subtitle Εditor
https://www.jubler.org
Jublerscreenshotwebp

|

[TTML]字幕に時間表示 カウントアップv3(色々治した)


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*

com.cocolog-nifty.quicktimer.icefloe
*)
#
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application

###################################
##### 設定項目
###################################

###適応させるビデオのFPS値
set strFPS to ("50") as text
###【1】何分ぶん作成するか?
set numMinute to 60 as integer

###【2】カウント『アップ?=true』『ダウン?= false』
set boolCountUp to true as boolean

###【2】カウントアップ値どうする?
#100分の1単位は設定可能だがYoutube上で再現されないので最低値は10分の1秒まで
#カウントアップ値(10分の1秒)の場合
# set numTimeInterval to (100 / 1000)
#カウントアップ値(1秒)の場合
set numTimeInterval to 1


###################################
##### 処理開始
###################################
##18000=60x30x10=30分
###【1】繰り返し回数計算
if numTimeInterval < 1 then
  set numRepeatTImes to (numMinute * 60 * 10) as integer
  set boolDecimal to true as boolean
else
  set numRepeatTImes to (numMinute * 60) as integer
  set boolDecimal to false as boolean
end if
###################################
##### 日付コンポーネント
###################################
###【2】『アップ?』『ダウン?』
if boolCountUp is true then
  #保存ファイル名
  set strSaveFileName to "カウントアップタイマー.ttml" as text
  #カウントアップ値
  set numTimeInterval to numTimeInterval
  ###【カウントアップ】コンポーネント
  #タイムライン用の1時間スタート値
  set ocidDateComponents to refMe's NSDateComponents's alloc()'s init()
ocidDateComponents's setHour:1
ocidDateComponents's setMinute:0
ocidDateComponents's setSecond:0
  #表示テキスト用の0時スタート値
  set ocidDateComponentsText to refMe's NSDateComponents's alloc()'s init()
ocidDateComponentsText's setHour:0
ocidDateComponentsText's setMinute:0
ocidDateComponentsText's setSecond:0
else
  #保存ファイル名
  set strSaveFileName to "カウントダウンタイマー.ttml" as text
  #カウントダウン
  set numTimeInterval to -(numTimeInterval)
  ###【カウントダウン】コンポーネント
  #タイムライン用の1時間スタート値
  set ocidDateComponents to refMe's NSDateComponents's alloc()'s init()
ocidDateComponents's setHour:1
ocidDateComponents's setMinute:(numMinute)
ocidDateComponents's setSecond:0
  #表示テキスト用の0時スタート値
  set ocidDateComponentsText to refMe's NSDateComponents's alloc()'s init()
ocidDateComponentsText's setHour:0
ocidDateComponentsText's setMinute:(numMinute)
ocidDateComponentsText's setSecond:0
end if
###カレンダー初期化
set ocidCalendar to refMe's NSCalendar's currentCalendar()
set ocidCalendarText to ocidCalendar
###↑の時間をセット
set ocidDate to ocidCalendar's dateFromComponents:(ocidDateComponents)
set ocidDateText to ocidCalendarText's dateFromComponents:(ocidDateComponentsText)
###################################
###日付コンポーネントを利用したカウントダウン
###################################
###【XML】 TTMLのdivエレメントを生成しておく
set ocidDiv to refMe's NSXMLNode's elementWithName:"div"
set ocidSetAttribute to refMe's NSXMLNode's attributeWithName:"xml:id" stringValue:"D0"
ocidDiv's addAttribute:(ocidSetAttribute)
set ocidSetAttribute to refMe's NSXMLNode's attributeWithName:"region" stringValue:"R0"
ocidDiv's addAttribute:(ocidSetAttribute)
set ocidSetAttribute to refMe's NSXMLNode's attributeWithName:"style" stringValue:"S0"
ocidDiv's addAttribute:(ocidSetAttribute)

###繰返しカウントアップ
repeat numRepeatTImes times
  
  ###【スタートタイム】日付時間の書式設定
  set ocidDateFormatterForBegin to refMe's NSDateFormatter's alloc()'s init()
  ##ocidDateFormatterForBegin's setLocale:(refMe's NSLocale's localeWithLocaleIdentifier:"en_US")
ocidDateFormatterForBegin's setDateFormat:"HH:mm:ss.S00"
  set ocidDateStringsBegin to ocidDateFormatterForBegin's stringFromDate:(ocidDate)
  ###【表示テキスト】日付時間の書式設定
  set ocidDateFormatterForText to refMe's NSDateFormatter's alloc()'s init()
  ##ocidDateFormatterForText's setLocale:(refMe's NSLocale's localeWithLocaleIdentifier:"en_US")
  ## ocidDateFormatterForText's setDateFormat:"H:mm:ss.S"
  if boolDecimal is true then
ocidDateFormatterForText's setDateFormat:"H:mm:ss.S"
  else
ocidDateFormatterForText's setDateFormat:"H:mm:ss"
  end if
  ###書式でテキスト化
  set ocidDateStrings to ocidDateFormatterForText's stringFromDate:(ocidDateText)
  
  ###次のカウントアップ用に、カウントアップした値をセット
  ###タイムインターバルをセット
  set ocidNewDate to ocidDate's dateByAddingTimeInterval:(numTimeInterval)
  set ocidNewDateText to ocidDateText's dateByAddingTimeInterval:(numTimeInterval)
  
  ###【エンドタイム】日付時間の書式設定
  set ocidDateFormatterForEnd to refMe's NSDateFormatter's alloc()'s init()
  ##ocidDateFormatterForEnd's setLocale:(refMe's NSLocale's localeWithLocaleIdentifier:"en_US")
ocidDateFormatterForEnd's setDateFormat:"HH:mm:ss.S00"
  set ocidDateStringsEnd to ocidDateFormatterForEnd's stringFromDate:(ocidNewDate)
  ###【XML】
  set ocidParagraphElement to (refMe's NSXMLElement's alloc()'s initWithName:("p"))
  #表示テキストをセット
  set ocidSetNode to (refMe's NSXMLNode's textWithStringValue:(ocidDateStrings))
(ocidParagraphElement's addChild:(ocidSetNode))
  #スタートタイム
  set ocidSetNode to refMe's NSXMLNode's attributeWithName:("begin") stringValue:(ocidDateStringsBegin)
ocidParagraphElement's addAttribute:(ocidSetNode)
  #エンドタイム
  set ocidSetNode to refMe's NSXMLNode's attributeWithName:("end") stringValue:(ocidDateStringsEnd)
ocidParagraphElement's addAttribute:(ocidSetNode)
  #生成されたPエレメントをDIVエレメントにセット
(ocidDiv's addChild:(ocidParagraphElement))
  
  ###次のリピートに備える
  set ocidDate to ocidNewDate
  set ocidDateText to ocidNewDateText
  ###出来上がりP要素をテキストに『アペンド』する
  #ocidOutPutStrings's appendString:strXMLP
end repeat

########################
##TTML生成開始

###ROOT エレメント
set ocidRootElement to refMe's NSXMLElement's alloc()'s initWithName:("tt")
###ROOT エレメントにネームスペース
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:frameRate") stringValue:(strFPS))
# smpte clock media から ビデオ編集用ならmediaが使いやすい
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:timeBase") stringValue:("media"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:lang") stringValue:("en"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns") stringValue:("http://www.w3.org/ns/ttml"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ttm") stringValue:("http://www.w3.org/ns/ttml#metadata"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:tts") stringValue:("http://www.w3.org/ns/ttml#styling"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ttp") stringValue:("http://www.w3.org/ns/ttml#parameter"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ittp") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1#parameter"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:itts") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1#styling"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:profile") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1/text"))

############ head
set ocidHead to refMe's NSXMLNode's elementWithName:"head"
ocidRootElement's addChild:(ocidHead)
##styling
set ocidStyling to refMe's NSXMLNode's elementWithName:"styling"
set ocidStyle to refMe's NSXMLNode's elementWithName:"style"

set ocidElementDict to refMe's NSXMLNode's attributeWithName:"xml:id" stringValue:"S0"
ocidStyle's addAttribute:ocidElementDict
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:color" stringValue:"#ffffff"
ocidStyle's addAttribute:ocidElementDict
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:opacity" stringValue:"0.75"
ocidStyle's addAttribute:ocidElementDict
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:fontSize" stringValue:"100%"
ocidStyle's addAttribute:ocidElementDict
### "default"| "monospace"| "sansSerif"| "serif"| "monospaceSansSerif"| "monospaceSerif"| "proportionalSansSerif"| "proportionalSerif"
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:fontFamily" stringValue:"proportionalSansSerif"
ocidStyle's addAttribute:ocidElementDict
## left | center | right | start | end
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:textAlign" stringValue:"start"
ocidStyle's addAttribute:ocidElementDict

ocidStyling's addChild:(ocidStyle)
ocidHead's addChild:(ocidStyling)

############ layout
set ocidLayout to refMe's NSXMLNode's elementWithName:"layout"
ocidHead's addChild:ocidLayout
##region
set ocidRegion to refMe's NSXMLNode's elementWithName:"region"
ocidLayout's addChild:ocidRegion
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"xml:id" stringValue:"R0"
ocidRegion's addAttribute:ocidElementDict
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:origin" stringValue:"0.000% 30%"
ocidRegion's addAttribute:ocidElementDict
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:extent" stringValue:"100.000% 0%"
ocidRegion's addAttribute:ocidElementDict
###before | center | after
set ocidElementDict to refMe's NSXMLNode's attributeWithName:"tts:displayAlign" stringValue:"center"
ocidRegion's addAttribute:ocidElementDict

############ body
set ocidBodyElement to refMe's NSXMLNode's elementWithName:"body"
##DIV要素をBODYにセット
(ocidBodyElement's addChild:(ocidDiv))
##BODYをROOTにセット
ocidRootElement's addChild:(ocidBodyElement)
##
set ocidOutPutXML to refMe's NSXMLDocument's alloc()'s initWithRootElement:(ocidRootElement)
ocidOutPutXML's setVersion:"1.0"
ocidOutPutXML's setCharacterEncoding:"UTF-8"

####################
####保存
##################
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set ocidSaveFilePathURL to ocidDesktopDirPathURL's URLByAppendingPathComponent:(strSaveFileName)

###【6】XMLデータにして(ここでテキスト形式のXMLに)
set ocidXMLdata to ocidOutPutXML's XMLDataWithOptions:(refMe's NSXMLNodePrettyPrint)
###【7】ファイルに保存
set listDone to ocidXMLdata's writeToURL:(ocidSaveFilePathURL) options:(refMe's NSDataWritingAtomic) |error|:(reference)

|

[TTML]テキストデータからTTMLを作成する(ちょっと修正)


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application
set appFileManager to refMe's NSFileManager's defaultManager()

##設定項目
###カウントアップ値(10分の1秒) 例=3.0だと行毎で3秒間隔で作成
set numTimeInterval to 3.0 as number
###時間のスタート 1か0か-->仕様を確認してください
set numStartH to 1 as integer
#【A】ROOT
##FPS 1秒間のフレーム数 ビデオの仕様を確認して設定
##指定のない場合は25 50 100 が計算しやすい
set strFPS to ("50") as text
#【B】HEAD共通のID
set strID to ("div01") as text
#【B−1】HEADのstyling
#配置位置 Youtubeは基本center
#"before" | "center" | "after" | "justify"
set strDisplayAlign to ("center") as text
##########
##テキスト
##文字色 HEX指定
set strTextColor to ("#ffffff") as text
# 0-1 0が完全透明 1が透明なし
set strTextOpacity to ("0.8") as text
#テキストのアウトライン
#なしの場合はテキスト色 で0px
set strTextOutline to ("#646364 1px") as text

##テキストの寄せ位置 Youtubeは基本center
#"left" | "center" | "right" | "start" | "end" | "justify"
set strTextAlign to ("center") as text
##########
##フォント
##100%=72pt=1in 50%で36pt 25%=18pt
set strFontSize to ("100%") as text
##フォントファミリー
##PostScript FamilyNameで指定も可能
#"default","monospace","sansSerif","serif","monospaceSansSerif","monospaceSerif","proportionalSansSerif","proportionalSerif"
set strFontFamily to ("proportionalSerif") as text
##フォントの装飾 基本はnormal
#"normal", "italic" ,"oblique"
set strFontStyle to ("normal") as text
#"normal" | "bold" 基本はnormal
set strFontWeight to ("normal") as text
##シャドウ RGBA指定も可
set strTextShadow to ("1.1px 1.1px 8px #081020")

#【B−2】HEADのlayout
#前半の0%は固定 後半の値 100%が画面下部 0%が画面上部
set strOrigin to ("0% 90%") as text
# 他の値はYoutubeでは無用なので設定省略

#############################
##ダイアログを前面に
tell current application
  set strName to name as text
end tell
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
############ デフォルトロケーション
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias
############UTIリスト
set listUTI to {"public.text", "public.plain-text"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  ### ファイル選択時
  set aliasFilePath to (choose file strMes with prompt strPrompt default location aliasDefaultLocation of type listUTI without invisibles, multiple selections allowed and showing package contents) as alias
on error
log "エラーしました"
return "エラーしました"
end try
###入力パス
set strFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
set strFileName to (ocidFilePathURL's lastPathComponent()) as text
########################
##テキスト読み込み
set listReadText to refMe's NSString's alloc()'s initWithContentsOfURL:(ocidFilePathURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
set ocidReadText to (item 1 of listReadText)
####行毎のリストにしておく
set ocidChrSet to refMe's NSCharacterSet's newlineCharacterSet
set ocidReadTextArray to ocidReadText's componentsSeparatedByCharactersInSet:(ocidChrSet)
########################
##保存先パス
set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
##保存ファイルパス
set strSaveFileName to (strFileName & ".ttml") as text
set ocidSaveFilePathURL to ocidContainerDirPathURL's URLByAppendingPathComponent:(strSaveFileName)
########################
##TTMLの時間の初期化
set ocidDateComponents to refMe's NSDateComponents's alloc()'s init()
##時間を1でスタートする場合は1
ocidDateComponents's setHour:(numStartH)
ocidDateComponents's setMinute:0
ocidDateComponents's setSecond:0
###カレンダー初期化
set ocidCalendar to refMe's NSCalendar's currentCalendar()
###↑の時間をセット
set ocidTime to ocidCalendar's dateFromComponents:(ocidDateComponents)
###日付時間の書式設定
set ocidDateFormatter to refMe's NSDateFormatter's alloc()'s init()
(ocidDateFormatter's setLocale:(refMe's NSLocale's localeWithLocaleIdentifier:"en_US"))
(ocidDateFormatter's setDateFormat:"HH:mm:ss.SSS")
########################
##TTML生成開始
###【A】ROOT エレメント
set ocidRootElement to refMe's NSXMLElement's alloc()'s initWithName:("tt")
###【A-1】ROOT エレメントにネームスペース
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:frameRate") stringValue:(strFPS))
# smpte clock media から ビデオ編集用ならmediaが使いやすい
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:timeBase") stringValue:("media"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:lang") stringValue:("en"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns") stringValue:("http://www.w3.org/ns/ttml"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ttm") stringValue:("http://www.w3.org/ns/ttml#metadata"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:tts") stringValue:("http://www.w3.org/ns/ttml#styling"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ttp") stringValue:("http://www.w3.org/ns/ttml#parameter"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ittp") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1#parameter"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:itts") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1#styling"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:profile") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1/text"))
##################
###【B】head エレメント
set ocidHeadElement to refMe's NSXMLElement's alloc()'s initWithName:("head")
###【B-1】styling エレメント
set ocidStylingElement to refMe's NSXMLElement's alloc()'s initWithName:("styling")
###【B-1-1】styling エレメント
set ocidStyleElement to refMe's NSXMLElement's alloc()'s initWithName:("style")
set strStyleID to (strID & "s")
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:id") stringValue:(strStyleID))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:displayAlign") stringValue:(strDisplayAlign))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:color") stringValue:(strTextColor))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:textShadow") stringValue:(strTextShadow))

ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:opacity") stringValue:(strTextOpacity))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontSize") stringValue:(strFontSize))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontFamily") stringValue:(strFontFamily))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontStyle") stringValue:(strFontStyle))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontWeight") stringValue:(strFontWeight))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:textOutline") stringValue:(strTextOutline))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:textAlign") stringValue:(strTextAlign))
## StyleをStylingにセット
(ocidStylingElement's addChild:(ocidStyleElement))
## Styling を Headにセット
(ocidHeadElement's addChild:(ocidStylingElement))
###【B-2】layout エレメント
set ocidLayoutElement to refMe's NSXMLElement's alloc()'s initWithName:("layout")
###【B-2-1】region エレメント
set ocidRegionElement to refMe's NSXMLElement's alloc()'s initWithName:("region")
set strRegionID to (strID & "r")
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:id") stringValue:(strRegionID))
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:origin") stringValue:(strOrigin))
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:extent") stringValue:("100% 0%"))
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:displayAlign") stringValue:("center"))
## RegionをLayoutにセット
(ocidLayoutElement's addChild:(ocidRegionElement))
## LayoutをHeadにセット
(ocidHeadElement's addChild:(ocidLayoutElement))
## Headをrootエレメントにセット
(ocidRootElement's addChild:(ocidHeadElement))
##################
###【C】Body エレメント
set ocidBodyElement to refMe's NSXMLElement's alloc()'s initWithName:("body")
###【C-1】div エレメント divは複数設定可能なので エレメント名に番号を入れる
set ocidDiv01Element to refMe's NSXMLElement's alloc()'s initWithName:("div")
ocidDiv01Element's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:id") stringValue:(strID))
ocidDiv01Element's addAttribute:(refMe's NSXMLNode's attributeWithName:("style") stringValue:(strStyleID))
ocidDiv01Element's addAttribute:(refMe's NSXMLNode's attributeWithName:("region") stringValue:(strRegionID))
###【C-1-1】ここが各行のテキストになる
repeat with itemReadText in ocidReadTextArray
  set ocidParagraphElement to (refMe's NSXMLElement's alloc()'s initWithName:("p"))
  set ocidSetNode to (refMe's NSXMLNode's textWithStringValue:(itemReadText))
  #各行のテキストデータ=NODEをPにセット
(ocidParagraphElement's addChild:(ocidSetNode))
  ###時間を書式でテキスト化
  set ocidDateStrings to (ocidDateFormatter's stringFromDate:(ocidTime))
  ##開始時間としてセット
(ocidParagraphElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("begin") stringValue:(ocidDateStrings)))
  ###日付時間の書式設定
  ###タイムインターバルをセット
  set ocidNewDate to (ocidTime's dateByAddingTimeInterval:(numTimeInterval))
  ###インターバル分追加した時間をテキストにして
  set ocidDateStrings to (ocidDateFormatter's stringFromDate:(ocidNewDate))
  ##end時間としてセット
(ocidParagraphElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("end") stringValue:(ocidDateStrings)))
  ##加算された時間を次のリピートの開始時間とするためにセット
  set ocidTime to ocidNewDate
  ##1行分のPデータを親要素のDIVにセットする
(ocidDiv01Element's addChild:(ocidParagraphElement))
end repeat
##DIV要素をBODYにセット
(ocidBodyElement's addChild:(ocidDiv01Element))
##BODYをROOTエレメントにセット
(ocidRootElement's addChild:(ocidBodyElement))
##【D】保存
###【XML】↑からのROOTエレメントをセットしてXMLとする 【A】をXMLドキュメントにする
set ocidOutPutXML to refMe's NSXMLDocument's alloc()'s initWithRootElement:(ocidRootElement)
ocidOutPutXML's setVersion:"1.0"
ocidOutPutXML's setCharacterEncoding:"UTF-8"
###XML形式のテキストに出力
set ocidSaveStrings to ocidOutPutXML's XMLString()
###改行コードを指定して
ocidSaveStrings's appendString:"\n"
##上書きチェック
set ocidSaveFilePath to doChkExists(ocidSaveFilePathURL)
set ocidSaveFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidSaveFilePath) isDirectory:false)
##保存
set listDone to ocidSaveStrings's writeToURL:(ocidSaveFilePathURL) atomically:true encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)

return



####################################
#上書きチェック
# ocid file path = NSPathStore を返します
####################################
to doChkExists(argFilePath)
log (className() of argFilePath) as text
  if (class of argFilePath) is text then
log "テキストファイルパス"
    set ocidFilePathStr to refMe's NSString's stringWithString:(argFilePath)
    set ocidArgFilePath to ocidFilePathStr's stringByStandardizingPath()
  else if (class of argFilePath) is alias then
log "エリアスファイルパス"
    set strArgFilePath to (POSIX path of argFilePath) as text
    set ocidFilePathStr to refMe's NSString's stringWithString:(argFilePath)
    set ocidArgFilePath to ocidFilePathStr's stringByStandardizingPath()
  else if (class of argFilePath) is «class furl» then
log "エリアスfurlファイルパス"
    set aliasFilePath to argFilePath as alias
    set strArgFilePath to (POSIX path of argFilePath) as text
    set ocidFilePathStr to refMe's NSString's stringWithString:(argFilePath)
    set ocidArgFilePath to ocidFilePathStr's stringByStandardizingPath()
  else if (className() of argFilePath as text) contains "NSCFString" then
log "NSStringファイルパス"
    set ocidArgFilePath to argFilePath's stringByStandardizingPath()
  else if (className() of argFilePath as text) contains "NSPathStore" then
log "NSPathStore2ファイルパス"
    set ocidArgFilePath to argFilePath
  else if (className() of argFilePath as text) contains "NSURL" then
log "NSURLファイルパス"
    set ocidArgFilePath to argFilePath's |path|
  end if
  ####
  set appFileManager to refMe's NSFileManager's defaultManager()
  set boolExists to appFileManager's fileExistsAtPath:(ocidArgFilePath) isDirectory:(false)
  #
  if boolExists = true then
    ##ダイアログを前面に
    set strName to (name of current application) as text
    if strName is "osascript" then
      tell application "Finder" to activate
    else
      tell current application to activate
    end if
    set strMes to "上書きします?" as text
    try
      set objResponse to (display alert strMes buttons {"上書きする", "処理を中止する", "ファイル名を変更"} default button "上書きする" cancel button "処理を中止する" as informational giving up after 20)
    on error
log "処理を中止しました"
return "処理を中止しました"
      error number -128
    end try
    if true is equal to (gave up of objResponse) then
log "時間切れですやりなおしてください"
return "時間切れですやりなおしてください"
      error number -128
    end if
    if "上書きする" is equal to (button returned of objResponse) then
log "上書き保存します"
      set ocidReturnFilePath to ocidArgFilePath
    else if "ファイル名を変更" is equal to (button returned of objResponse) then
log "ファイル名を変更"
      set ocidContainerDirFilePath to ocidArgFilePath's stringByDeletingLastPathComponent()
      set strFileName to ocidArgFilePath's lastPathComponent() as text
      set aliasContainerDirPath to (POSIX file (ocidContainerDirFilePath as text)) as alias
      ##
      set strPromptText to "名前を決めてください" as text
      set strMesText to "名前を決めてください" as text
      ###ファイル名 ダイアログ
      set aliasFilePath to (choose file name strMesText default location aliasContainerDirPath default name strFileName with prompt strPromptText) as «class furl»
      set strFilePath to (POSIX path of aliasFilePath) as text
      set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
      set ocidReturnFilePath to ocidFilePathStr's stringByStandardizingPath()
    else if "処理を中止する" is equal to (button returned of objResponse) then
return "処理を中止しました"
    else
return "エラーしました"
      error number -128
    end if
  else if boolExists = false then
log "そのままファイル生成"
    set ocidReturnFilePath to ocidArgFilePath
  end if
return ocidReturnFilePath
  
end doChkExists

|

[TTML]テキストデータからTTMLを作成する


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application
set appFileManager to refMe's NSFileManager's defaultManager()

##設定項目
###カウントアップ値(10分の1秒)
set numTimeInterval to 3.0 as number
###時間のスタート 1か0か
set numStartH to 1 as integer
#【A】ROOT
##指定のない場合は25 50 100 が計算しやすい
set strFPS to ("50") as text
#【B】HEAD共通のID
set strID to ("div01") as text
#【B−1】HEADのstyling
#"before" | "center" | "after" | "justify"
set strDisplayAlign to ("center") as text
set strTextColor to ("#ffffff") as text
# 0-1 0が完全透明 1が透明なし
set strTextOpacity to ("0.8") as text
set strTextOutline to ("#646364 1px") as text
#"left" | "center" | "right" | "start" | "end" | "justify"
set strTextAlign to ("center") as text
set strFontSize to ("100%") as text
#"default","monospace","sansSerif","serif","monospaceSansSerif","monospaceSerif","proportionalSansSerif","proportionalSerif"
set strFontFamily to ("proportionalSerif") as text
#"normal", "italic" ,"oblique"
set strFontStyle to ("italic") as text
#"normal" | "bold"
set strFontWeight to ("bold") as text

#【B−2】HEADのlayout
#前半の0%は固定 後半の値 100%が画面下部 0%が画面上部
set strOrigin to ("0% 90%") as text
# 他の値はYoutubeでは無用なので設定省略


#############################
##ダイアログを前面に
tell current application
  set strName to name as text
end tell
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
############ デフォルトロケーション
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDefaultLocation to (ocidDesktopDirPathURL's absoluteURL()) as alias
############UTIリスト
set listUTI to {"public.text", "public.plain-text"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  ### ファイル選択時
  set aliasFilePath to (choose file strMes with prompt strPrompt default location aliasDefaultLocation of type listUTI without invisibles, multiple selections allowed and showing package contents) as alias
on error
log "エラーしました"
return "エラーしました"
end try
###入力パス
set strFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
set strFileName to (ocidFilePathURL's lastPathComponent()) as text
########################
##テキスト読み込み
set listReadText to refMe's NSString's alloc()'s initWithContentsOfURL:(ocidFilePathURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
set ocidReadText to (item 1 of listReadText)
####行毎のリストにしておく
set ocidChrSet to refMe's NSCharacterSet's newlineCharacterSet
set ocidReadTextArray to ocidReadText's componentsSeparatedByCharactersInSet:(ocidChrSet)
########################
##保存先パス
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
##保存ファイルパス
set strSaveFileName to (strFileName & ".ttml") as text
set ocidSaveFilePathURL to ocidDesktopDirPathURL's URLByAppendingPathComponent:(strSaveFileName)
########################
##TTMLの時間の初期化
set ocidDateComponents to refMe's NSDateComponents's alloc()'s init()
##時間を1でスタートする場合は1
ocidDateComponents's setHour:(numStartH)
ocidDateComponents's setMinute:0
ocidDateComponents's setSecond:0
###カレンダー初期化
set ocidCalendar to refMe's NSCalendar's currentCalendar()
###↑の時間をセット
set ocidTime to ocidCalendar's dateFromComponents:(ocidDateComponents)
###日付時間の書式設定
set ocidDateFormatter to refMe's NSDateFormatter's alloc()'s init()
(ocidDateFormatter's setLocale:(refMe's NSLocale's localeWithLocaleIdentifier:"en_US"))
(ocidDateFormatter's setDateFormat:"HH:mm:ss.SSS")
########################
##TTML生成開始
###【A】ROOT エレメント
set ocidRootElement to refMe's NSXMLElement's alloc()'s initWithName:("tt")
###【A-1】ROOT エレメントにネームスペース
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:frameRate") stringValue:(strFPS))
# smpte clock media から ビデオ編集用ならmediaが使いやすい
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:timeBase") stringValue:("media"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:lang") stringValue:("en"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns") stringValue:("http://www.w3.org/ns/ttml"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ttm") stringValue:("http://www.w3.org/ns/ttml#metadata"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:tts") stringValue:("http://www.w3.org/ns/ttml#styling"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ttp") stringValue:("http://www.w3.org/ns/ttml#parameter"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:ittp") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1#parameter"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xmlns:itts") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1#styling"))
ocidRootElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("ttp:profile") stringValue:("http://www.w3.org/ns/ttml/profile/imsc1/text"))
##################
###【B】head エレメント
set ocidHeadElement to refMe's NSXMLElement's alloc()'s initWithName:("head")
###【B-1】styling エレメント
set ocidStylingElement to refMe's NSXMLElement's alloc()'s initWithName:("styling")
###【B-1-1】styling エレメント
set ocidStyleElement to refMe's NSXMLElement's alloc()'s initWithName:("style")
set strStyleID to (strID & "s")
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:id") stringValue:(strStyleID))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:displayAlign") stringValue:(strDisplayAlign))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:color") stringValue:(strTextColor))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:opacity") stringValue:(strTextOpacity))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontSize") stringValue:(strFontSize))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontFamily") stringValue:(strFontFamily))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontStyle") stringValue:(strFontStyle))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:fontWeight") stringValue:(strFontWeight))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:textOutline") stringValue:(strTextOutline))
ocidStyleElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:textAlign") stringValue:(strTextAlign))
## StyleをStylingにセット
(ocidStylingElement's addChild:(ocidStyleElement))
## Styling を Headにセット
(ocidHeadElement's addChild:(ocidStylingElement))
###【B-2】layout エレメント
set ocidLayoutElement to refMe's NSXMLElement's alloc()'s initWithName:("layout")
###【B-2-1】region エレメント
set ocidRegionElement to refMe's NSXMLElement's alloc()'s initWithName:("region")
set strRegionID to (strID & "r")
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:id") stringValue:(strRegionID))
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:origin") stringValue:(strOrigin))
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:extent") stringValue:("100% 0%"))
ocidRegionElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("tts:displayAlign") stringValue:("center"))
## RegionをLayoutにセット
(ocidLayoutElement's addChild:(ocidRegionElement))
## LayoutをHeadにセット
(ocidHeadElement's addChild:(ocidLayoutElement))
## Headをrootエレメントにセット
(ocidRootElement's addChild:(ocidHeadElement))
##################
###【C】Body エレメント
set ocidBodyElement to refMe's NSXMLElement's alloc()'s initWithName:("body")
###【C-1】div エレメント divは複数設定可能なので エレメント名に番号を入れる
set ocidDiv01Element to refMe's NSXMLElement's alloc()'s initWithName:("div")
ocidDiv01Element's addAttribute:(refMe's NSXMLNode's attributeWithName:("xml:id") stringValue:(strID))
ocidDiv01Element's addAttribute:(refMe's NSXMLNode's attributeWithName:("style") stringValue:(strStyleID))
ocidDiv01Element's addAttribute:(refMe's NSXMLNode's attributeWithName:("region") stringValue:(strRegionID))
###【C-1-1】ここが各行のテキストになる
repeat with itemReadText in ocidReadTextArray
  set ocidParagraphElement to (refMe's NSXMLElement's alloc()'s initWithName:("p"))
  set ocidSetNode to (refMe's NSXMLNode's textWithStringValue:(itemReadText))
  #各行のテキストデータ=NODEをPにセット
(ocidParagraphElement's addChild:(ocidSetNode))
  ###時間を書式でテキスト化
  set ocidDateStrings to (ocidDateFormatter's stringFromDate:(ocidTime))
  ##開始時間としてセット
(ocidParagraphElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("begin") stringValue:(ocidDateStrings)))
  ###日付時間の書式設定
  ###タイムインターバルをセット
  set ocidNewDate to (ocidTime's dateByAddingTimeInterval:(numTimeInterval))
  ###インターバル分追加した時間をテキストにして
  set ocidDateStrings to (ocidDateFormatter's stringFromDate:(ocidNewDate))
  ##end時間としてセット
(ocidParagraphElement's addAttribute:(refMe's NSXMLNode's attributeWithName:("end") stringValue:(ocidDateStrings)))
  ##加算された時間を次のリピートの開始時間とするためにセット
  set ocidTime to ocidNewDate
  ##1行分のPデータを親要素のDIVにセットする
(ocidDiv01Element's addChild:(ocidParagraphElement))
end repeat
##DIV要素をBODYにセット
(ocidBodyElement's addChild:(ocidDiv01Element))
##BODYをROOTエレメントにセット
(ocidRootElement's addChild:(ocidBodyElement))
##【D】保存
###【XML】↑からのROOTエレメントをセットしてXMLとする 【A】をXMLドキュメントにする
set ocidOutPutXML to refMe's NSXMLDocument's alloc()'s initWithRootElement:(ocidRootElement)
ocidOutPutXML's setVersion:"1.0"
ocidOutPutXML's setCharacterEncoding:"UTF-8"
###XML形式のテキストに出力
set ocidSaveStrings to ocidOutPutXML's XMLString()
###改行コードを指定して
ocidSaveStrings's appendString:"\n"
##上書きチェック
set ocidSaveFilePath to ocidSaveFilePathURL's |path|()
set boolDirExists to appFileManager's fileExistsAtPath:(ocidSaveFilePath) isDirectory:(false)

if boolDirExists = true then
  set strMes to "上書きします?" as text
  try
    ##ダイアログを前面に
    if strName is "osascript" then
      tell application "Finder" to activate
    else
      tell current application to activate
    end if
    set objResponse to (display alert strMes buttons {"上書きする", "処理を中止する"} default button "上書きする" cancel button "処理を中止する" as informational giving up after 10)
  on error
log "処理を中止しました"
return "処理を中止しました"
    error number -128
  end try
  if true is equal to (gave up of objResponse) then
return "時間切れですやりなおしてください"
    error number -128
  end if
  if "上書きする" is equal to (button returned of objResponse) then
log "上書き保存します"
  else if "処理を中止する" is equal to (button returned of objResponse) then
return "処理を中止しました"
  else
return "エラーしました"
    error number -128
  end if
else if boolDirExists = false then
log "そのままファイル生成"
end if

##保存
set listDone to ocidSaveStrings's writeToURL:(ocidSaveFilePathURL) atomically:true encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)

return




|

より以前の記事一覧

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat AddOn Acrobat Annotation Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Menu Acrobat Open Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin Support Admin System Information Admin Tools Admin Users Admin Volumes Adobe Adobe FDKO Adobe RemoteUpdateManager AppKit Apple AppleScript AppleScript do shell script AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript System Events AppleScript System Events Plist AppleScript Video Applications AppStore Archive Attributes Automator BackUp Barcode Barcode QR Barcode QR Decode Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome CIImage CityCode CloudStorage Color com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Device Diff Disk Dock DropBox Droplet eMail Encode % Encode Decode Encode UTF8 Error EXIFData ffmpeg File Finder Firefox Folder FolderAction Fonts GIF github Guide HTML HTML Entity Icon Illustrator Image Events Image2PDF ImageOptim iPhone iWork Javascript Jedit Json Label Leading Zero List locationd LRC lsappinfo LSSharedFileList m3u8 Mail MakePDF Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Mouse Music NetWork Notes NSArray NSArray Sort NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSColor NSColorList NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSPrintOperation NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth OneDrive PDF PDFAnnotation PDFAnnotationWidget PDFContext PDFDisplayBox PDFDocumentPermissions PDFImageRep PDFKit PDFnUP PDFOutline perl Photoshop PlistBuddy pluginkit postalcode PostScript prefPane Preview Python QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver SF Symbols character id SF Symbols Entity sips Skype Slack Sound Spotlight sqlite SRT StandardAdditions Swift System Settings TCC TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code Wacom webarchive webp Wifi Windows XML XML EPUB XML OPML XML Plist XML RSS XML savedSearch XML SVG XML TTML XML webloc XML XMP YouTube zoom