Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Remove duplicate iMovie files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remove duplicate iMovie files
Authored by: ret on Nov 06, '06 05:33:52PM
I don't have an iMovie project at hand to test this with, but rather than futzing around with the project file, would linking (either soft or hard) the original file with the redundant file names achieve the same thing?
ie:
cd ~/Movies/MyGreatiMovie.imovieproject/Media
for dup in `ls -1 *_[1-9]`
do
  src=`echo $dup | sed 's/_[0-9]$//'`
  if [ -r "$src" ]
  then
     # file and file_N exist. move _N file and replace with link
     mv $dup ~/Movies
     ln -s $src $dup
     echo "Replaced $dup with link to $src"
   else
     echo "Can't find $src for $dup, skipping"
   fi
done
Note: Safari is a less-than-ideal syntax checker. Code above is not tested, just an example. It assumes the movie files don't have an extension suffix, which I thought they did (*.dv IIRC). I'm just working off the original hint. The script relocates the duplicated files into the "Movies" folder, so you can restore them easily if you find your iMovie borks on opening.
The line that creates the link could be changed from a soft-link to a hard-link by removing the "-s" argument. I guess if you know what "ln" does, you know that too...

cheers
RET

---
perl -e \'require Signature.pm; srand; printf STDOUT \"%s\\n\", $Signature[rand @Signature];\'

[ Reply to This | # ]