Monday, July 16, 2007

A new version of csound routines is out includes an autoit script and some popen code to run awk programs. Also included is a script to control gvim It is a working version of loading an orc into a csd. The code that is required to control gvim is listed below

from win32com.client.dynamic import Dispatch

def load_instrument_vim(csdfile, orcfile, tagname):
csdfile2 = re.sub(r"\\",r"/",csdfile) #replace \ with /
orcfile2 = re.sub(r"\\",r"/",orcfile) #re[lace \ with /
vim = Dispatch('Vim.Application')
os.path = 'c:\dex_tracker'
vim.SendKeys(':e '+ csdfile + '')
vim.SendKeys('/' + tagname + '')
vim.SendKeys(':r ' + orcfile2 +'')

It should reqire pywin. This is a much better example of the ole com control than is listed on the gvim website and it is very easy to write scripts for

Labels: , , , ,

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?