I'm sorry, I know next to nothing about Windows. The Python script I'm attaching does what you need, maybe it helps?

Maybe someone else can provide more relevant help.

Cheers,
Manolo

Thanks. I have use the commands for a singel lyx-document and it funktioned. But i do not know how i can "install" this script (I am using lyx at this time on windows 7 because i can not install my old opensuse on my new computer whith raid)?

Horst


import sys, os

def Lyxtotxt(n):    #Exports .lyx files to .txt
    argument = "lyx -e ps " + n
    os.system(argument)
    argument = "ps2ascii " + n[:-4] + ".ps " + n[:-4]  + ".txt"  #n[:-4] is the name of the file without extension
    os.system(argument)

if __name__ == "__main__":
    files = [f for f in os.listdir(os.getcwd()) if os.path.isfile(f)]   #puts every filename in the current directory in a list
    for f in files:
        if  (f[-3:]=="lyx"):
           inputfile = f.replace(' ', '\ ') #For a good parsing of spaces in file name
           Lyxtotxt(inputfile)

Reply via email to