Sparkle
12-15-2006, 09:04 AM
Maybe you know this Problem: You preview a scene, look at it and then continue to work in Cinema without closing Quicktime. Next time you want to preview you get an errormessage saying that the preview can't be written because the file is still in use (or something similar to this). If you are anything like me (and use Cinema 4d on a daily basis) you'll see this error message about 20 times a day. Annoying!
Of course you could just close the preview window everytime after you're done, but wouldn't it be nice if Cinema did that for you? To do that I wrote a little script. It currently only works on a mac because I'm using apple script to close Quicktime but I think something similar is possible on a PC. The only unresolved issue is, that I have to put the closeQT.app in the root directory of Cinema 4D (in the MAXON folder), which I feel is rather "unclean".
The (extremely basic) scribt goes like this:
var filename = GeGetStartupPath();
filename->SetLastString("closeQT.app"); // closeQT.app is the compiled apple script
GeExecuteFile(filename);
CallCommand(1000974);
The apple script is:
tell application "Quicktime Player"
quit
end tell
Now every time you start a preview the script first closes quicktime ant then starts the new preview.
If you have improvements for the script or a way to adapt this for a PC please feel free to post them.
My ideal way of this working would be as compiled .cob in a subfolder in the plugins directory, where according to the os (checked with GeGetCurrentOS()) the appropriate application for closing qt is called from within that subdirectory. I tried GeGetRootFilename() but it somehow didn't give me a useful path to the closeQT.app.
Cheers,
Sparkle
Of course you could just close the preview window everytime after you're done, but wouldn't it be nice if Cinema did that for you? To do that I wrote a little script. It currently only works on a mac because I'm using apple script to close Quicktime but I think something similar is possible on a PC. The only unresolved issue is, that I have to put the closeQT.app in the root directory of Cinema 4D (in the MAXON folder), which I feel is rather "unclean".
The (extremely basic) scribt goes like this:
var filename = GeGetStartupPath();
filename->SetLastString("closeQT.app"); // closeQT.app is the compiled apple script
GeExecuteFile(filename);
CallCommand(1000974);
The apple script is:
tell application "Quicktime Player"
quit
end tell
Now every time you start a preview the script first closes quicktime ant then starts the new preview.
If you have improvements for the script or a way to adapt this for a PC please feel free to post them.
My ideal way of this working would be as compiled .cob in a subfolder in the plugins directory, where according to the os (checked with GeGetCurrentOS()) the appropriate application for closing qt is called from within that subdirectory. I tried GeGetRootFilename() but it somehow didn't give me a useful path to the closeQT.app.
Cheers,
Sparkle
