Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Script to move .MOV videos off Canon EOS_Digital CF card on mount?

Script to move .MOV videos off Canon EOS_Digital CF card on mount?
Thread Tools
Dedicated MacNNer
Join Date: Jul 2007
Status: Offline
Reply With Quote
Dec 30, 2008, 06:11 PM
 
I use Adobe Lightroom as an integral part of my digital photography workflow, and I recently acquired a Canon EOS 5D Mark-II digital camera, which is capable of capturing 1920x1080 HD video.

The problem I am having is that Lightroom does not provide support for importing video, so every time I insert my compact flash card containing images and video captured using the 5D MKII, I am notified of videos on the card that cannot be transferred into my Lightroom database...I then have to click OK to dismiss this notification message, then I have to manually browse the card to find the movies and copy them to my computer manually...

While this might not seem like that big of an issue, I've become accustomed to this process being a completely automated, so to go back to having to perform a number of steps manually seems a bit too much like backtracking to me, so I was hoping that someone here might be able to help me automate this process via AppleScript...

• Ideally, a script that could be executed on my "EOS_Digital" volume (my CF card's name, which will always remain the same), and will scour the contents of that volume for .MOV files, and upon finding such files, it would copy them all to my ~/Movies/ directory before then removing (deleting) them from the card completely...

• The CF card will also contain .THM files that correspond to the .MOV files to provide thumbnails of the .MOV files for Windows users...I would ideally like to have these moved along with the .MOV files to the ~/Movies/ directory (or trashed completely), because Lightroom give me a notification warning that they cannot be imported into the image database

• I would trigger the script via QuickSilver (or FastScripts, QuicKeys, etc), which I could do manually after inserting my CF card...

I know it's a long shot that someone would be willing to help me out with this task, but any help at all would be greatly appreciated!!

Thanks so much, and I look forward to your responses!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Dec 30, 2008, 07:00 PM
 
Put this in a shell script:
Code:
find /Volumes/EOS_Digital \( -iname "*.mov" -or -iname "*.thm" \) -print0 | xargs -0 -J % mv % ~/Movies
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
m021478  (op)
Dedicated MacNNer
Join Date: Jul 2007
Status: Offline
Reply With Quote
Jan 2, 2009, 11:07 PM
 
Can you please embellish on the details of what the shell script will do?

If I wanted to setup this shell script to be used in Automator's "Run Shell Script" action, how would I do so (specifically, what would I choose in the "Shell ____" menu setting, and also for the "Pass Input:____" menu setting?

...and if possible, can you give me some ideas on how I might go about having this shell script triggered whenever the EOS_DIGITAL volume is mounted?

Thanks!
(Last edited by m021478; Jan 2, 2009 at 11:17 PM. )
     
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Jan 4, 2009, 05:19 AM
 
hi

find /Volumes/EOS_Digital \( -iname "*.mov" -or -iname "*.thm" \) -print0 | xargs -0 -J % mv % ~/Movies


find = search a folder using pattern matching

| = take the results and send them on to the next thing

xargs = pull some specific bits out of what came from "find" (presumably the file name of each found movie) and use that to build a move command: mv

mv = move file x to folder y


This script may not delete the movies from the CF card - OS X copies rather then moves when moving between volumes. So you may need an extra step to delete the files. However this may only apply to the finder not the mv command, so test it.

automator is overkill - it will be easier to just write a quick applescript in script editor. It should be as simple as a single line:

do shell script "find /Volumes/EOS_Digital \( -iname "*.mov" -or -iname "*.thm" \) -print0 | xargs -0 -J % mv % ~/Movies"

Paste that into script editor, save it as an application - then just double click it after you mount the CF card.

My guess is that making a script run automatically when a particular cf card is mounted is
going to be a real bugger.
You can take the dude out of So Cal, but you can't take the dude outta the dude, dude!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jan 4, 2009, 12:56 PM
 
Originally Posted by m021478 View Post
Can you please embellish on the details of what the shell script will do?
It searches for files whose names are [anything].mov or [anything].thm in /Volumes/EOS_DIGITAL and passes them to the command mv [FILENAMES] ~/Movies, which moves the files (deleting them from the original volume) to the folder Movies in your home folder.

Originally Posted by m021478 View Post
If I wanted to setup this shell script to be used in Automator's "Run Shell Script" action, how would I do so (specifically, what would I choose in the "Shell ____" menu setting, and also for the "Pass Input:____" menu setting?
The shell should be /bin/bash and the Pass Input setting doesn't make a difference since the action isn't getting any input.

Originally Posted by m021478 View Post
...and if possible, can you give me some ideas on how I might go about having this shell script triggered whenever the EOS_DIGITAL volume is mounted?
Have it triggered automatically? Honestly, I can't think of anything beyond writing a small wrapper app that runs all the time watching for EOS_DIGITAL.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:52 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2