Here’s a fun one. Run this script and it will import every Quicktime on your hard drive or mounted server that After Effects understands. Stupidest hack ever, right? Well yeah, but there is some real gold in this line of the script
mdfind 'kMDItemKind == "QuickTime Movie"'
mdfind is the command line version of Apple’s spotlight technology. Combined with the new Quicktime metadata API and system.callSystem() there’s a lot for a hungry developer to chew on.
The script, osX 10.4(Tiger) and After Effects 7 only (I know, I know)
var myProject = app.project;
var osString = "mdfind 'kMDItemKind == "QuickTime Movie"' | wc -l" ;
var numberOfQTs = system.callSystem(osString);
//After Effects seems to choke when I feed it more than 41 items at a time, so let's use sed to give it 40 to chew on at a time
for(x=1; x < numberOfQTs; x = x + 40){
var osString = "mdfind 'kMDItemKind == "QuickTime Movie"' | sed -n '" + x + ", " + ( x + 40) + "p'";
//alert(osString);
var systemCall = system.callSystem(osString);
var movArray= systemCall.split("\n");
for(y=0; y < movArray.length; y++){
try{
var my_io = new ImportOptions(new File( movArray[y]));
var myItem = myProject.importFile(my_io);
}catch(e){
//eat errors
}
}
}
And the downloadable version
importEveryQuicktime.jsx.zip
followup 5/4/2006 2:30P EST:
So, most folks working in motion graphics have a lot of quicktimes on their system and don't necessarily want to take a long time to import all of them into an After Effects project as a proof of concept ( I told you this was a Stupid Scripting Trick). Therefore, here's a version that imports the first 20 of them with head -n 20 to act as a proof of concept for you busy people .
Here ya go:
import20Quicktimes.jsx.zip
You'll need to turn on Allow Scripts to Write Files and Access Network and turn off Enable JavaSript Debugger so we can eat the errors. As in anything that allows write access to your file system, be careful in experimenting with this script.
Why you should learn to love your brother’s tech
May 23, 2006 at 2:34 pm · Filed under Commentary
What I’ve noticed from trying to stay platform agnostic for a while is that there are a lot of great ideas and techniques that tend to be blindingly obvious and part of muscle memory on one platform that are either unavailable or under used on the other. Today’s example is one that is part of almost every Windows users toolkit, but hasn’t been available as long on the Macintosh and ends up being under used.
Let’s say your working in Final Cut Pro and you’re saving a file. You’re working on a complicated project and the file names are variations of a base filename. You’ve opened up the save dialog and your presented with something like…
So, we’ll just start typing our long filename and…Not so fast. If you take your cursor and select the grayed out filename from the dialog below, you’ll get…
The name of the file you just selected, inserted into the text field ready for you to append a new version number. Seven out of ten Macintosh users don’t know about this feature just as seven out of ten Windows users are aware of it. Cross-cultural technology astigmatism can bite you in the butt.
The funny thing is from a user interface stand point you can argue this is a bug not a feature. On the Macintosh grey text indicates that the interface cue is inactive. So, if you were really a platform zealot you would say that they need to take this away in the next version of OSX or at least give us some indication that it is selectable. Maybe so, but once again I’ll just try to get my work done faster and easier.
Permalink Comments (2)