VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Jun 2011
    Location
    Brazil
    Search PM
    I see Subtitle Workshop doesn't have this option. I want to save the subtitles I have to *.txt (UTF-8) without the time codes, just plain text without the numbers and commas in order to make screenplays based on the text. I know I can do it manually, but I need a script to do it automated.


    like this:

    6
    00:00:22,490 --> 00:00:23,959
    Hello, how are

    7
    00:00:23,959 --> 00:00:27,490
    you man?

    to

    Hello, how are you man?
    Quote Quote  
  2. you can do this with aegisub

    file=>export subtitles=>export=> drop down menu select "plain text"
    Quote Quote  
  3. Hi,

    I did what you suggested and it doesn't work. I got a new file with the following message: "# Exported by Aegisub 3.0.2" and without any text of the subtitle.

    What should I do!?
    Quote Quote  
  4. I have written an AHK_L script that should output a .txt file for every .srt file you drop on it. It has to be compiled with AutoHotKey_L free scripting language compiler for the drop on the program shortcut to work. Also you should not have any spaces in the path of the .srt files.

    I usually work in ASCII. That's why I'm giving you the source. If you need help fixing it up you can ask on AutoHotKey forums.

    How it works. You select .srt files in Explorer and drag and drop them on the program icon. For each file it creates filename.srt.txt as output. It sets output file type to UTF-8 and writes all lines that are not the subtitle number or timing lines.

    An alternative might be a programmable editor. But this could be easy to use once you get the bugs out.
    Here's the source

    Code:
    #NoEnv
    #NoTrayIcon
    SendMode Input
    Count := 0
    FE := A_FileEncoding
    
    If 0 < 1
    {
        MsgBox, 64, Srt2Text Usage, Srt2Text Copyright (c)  %A_Year% www.FavesSoft.com`n`nUsage: Drag and Drop .srt files on shortcut`n`nOutput is filename.srt.txt`n`nOnly dialog paragraphs are written using UTF-8 encoding
        ExitApp
    }
    
    Loop %0%  ; For each parameter (or file dropped onto a script):
    {
        Param := %A_Index%  ; Fetch the contents of the variable whose name is contained in A_Index.
        Loop %Param%
        {
        Count := Count + 1
            InPath = %A_LoopFileLongPath%
            OutPath := InPath ".txt"
            IfExist,%OutPath%
                FileDelete,%OutPath%
            Loop, read, %InPath%,%OutPath%
            {
          if A_LoopReadLine is Integer
            continue
                if InStr(A_LoopReadLine," --> ")
            continue
          FileEncoding,UTF-8
                FileAppend,%A_LoopReadLine%`n
          FileEncoding,%FE%
            }
        }
    }
    MsgBox, 8256, Srt2Text, %Count%  Files Processed
    http://milesaheadsoftware.org/
    Fully enabled freeware for Windows PCs.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!