Running scripts via Visual Basic
Posted: January 19th, 2009, 2:09 pm
Hey,
I wrote a program in VB that loads a .aep project, then executes a script. Only problem is VB doesn't come with an After Effects library like it does for photoshop, so there isn't a nice clean way of doing this. It can be done, but it's kinda messy.
I had to launch after effects as a windows process, then make a call to shell, passing the script I want to run as an argument. So that works, it launches after effects and begins executing the script. But the problem is that while AE is loading (splash screen.. etc) the script tries to run. It gives an error because at that point the script library isn't yet loaded in AE.
So I have to manually add a delay, say 5 or 10 seconds, to wait for AE to open, then run the script.
Basically, there's no way that Visual Basic can communicate with after effects. So I can't say.. 'wait until after effects loads, then run the script'. It runs the script immediately. So it looks like I need a way of determining when after effects is loaded and ready to run scripts in VB. Or I need an alternate way of launching AE + run script in visual basic beside the method I'm using.
Does anybody know of a way?? Or am I out of luck?? Thanks~
I wrote a program in VB that loads a .aep project, then executes a script. Only problem is VB doesn't come with an After Effects library like it does for photoshop, so there isn't a nice clean way of doing this. It can be done, but it's kinda messy.
I had to launch after effects as a windows process, then make a call to shell, passing the script I want to run as an argument. So that works, it launches after effects and begins executing the script. But the problem is that while AE is loading (splash screen.. etc) the script tries to run. It gives an error because at that point the script library isn't yet loaded in AE.
So I have to manually add a delay, say 5 or 10 seconds, to wait for AE to open, then run the script.
Basically, there's no way that Visual Basic can communicate with after effects. So I can't say.. 'wait until after effects loads, then run the script'. It runs the script immediately. So it looks like I need a way of determining when after effects is loaded and ready to run scripts in VB. Or I need an alternate way of launching AE + run script in visual basic beside the method I'm using.
Does anybody know of a way?? Or am I out of luck?? Thanks~