View Full Version : Help with copying pics from CF Card
spockling
Mar-22-2005, 07:57 AM
Is there any way that I can run a script/batch file/action in either xp, dos or photoshop cs that would download my pictures from my cf card(both raw and jpg) into separate directories?
I am trying to automate a few things to speed up my workflow.
Thanks in advance for any help.
Andy
Mar-22-2005, 01:46 PM
Is there any way that I can run a script/batch file/action in either xp, dos or photoshop cs that would download my pictures from my cf card(both raw and jpg) into separate directories?
I am trying to automate a few things to speed up my workflow.
Thanks in advance for any help.
bump. oh and you should ping nikolai, he's good at this stuff :deal
Nikolai
Mar-23-2005, 05:40 AM
If you simply want it *done*, always in one way and don't mind some batch file programming it can be relatively easy:
Create new cmd/bat file and set its contents to the following:
@echo off
: Set these names to your setup/liking..
SET SRC_DIR=F:\DCIM\MISC
SET JPG_MASK=*.jpg
SET MOV_MASK=*.mpg
SET RAW_MASK=*.srf
SET TGT_ROOT_DIR=%HOMEDRIVE%%HOMEPATH%\Files_From_Came ra
SET JPG_DIR=My_New_Jpegs
SET MOV_DIR=My_New_Movies
SET RAW_DIR=My_New_Raws
:----
: Now to the confirmation
:--
echo This will copy files from %SRC_DIR% into %ROOT_TGT__DIR%
echo Press ENTER to continue, Ctrl+C to quit
pause>nul
:====
: Check all the dirs
:==
SET TST_DIR=%SRC_DIR%
if not exist %TST_DIR%\nul then goto NODIR
SET TST_DIR=%TGT_ROOT_DIR%
if not exist %TST_DIR%\nul then goto NODIR
SET TST_DIR=%TGT_ROOT_DIR%\%JPG_DIR%
if not exist %TST_DIR%\nul then goto NODIR
SET TST_DIR=%TGT_ROOT_DIR%\%MOV_DIR%
if not exist %TST_DIR%\nul then goto NODIR
SET TST_DIR=%TGT_ROOT_DIR%\%RAW_DIR%
if not exist %TST_DIR%\nul then goto NODIR
:****
: all folders seem to be ok, let do some copying..
:**
for %%f in (%SRC_DIR%\%JPG_MASK) do copy /b /v %%f %TGT_ROOT_DIR%\%JPG_DIR%\
for %%f in (%SRC_DIR%\%MOV_MASK) do copy /b /v %%f %TGT_ROOT_DIR%\%MOV_DIR%\
for %%f in (%SRC_DIR%\%RAW_MASK) do copy /b /v %%f %TGT_ROOT_DIR%\%RAW_DIR%\
goto EXIT
:NODIR
echo Directory %SRC_DIR% not found, please create one first
goto EXIT
:EXIT
echo Press ENTER to exit or simply close this window...
pause>nul
Same stuff can be achieved in a less arcane way via VB script (which is supported on most of the nowadays PCs automatically)
Finally, if you want auto detection of the card insertion/removal, persistent settings, fancy progress indicator - well, this is a subject for custom programming (http://www.smugmugexplorer.com/SE_services.htm)...:-)
HTH
Nik
bump. oh and you should ping nikolai, he's good at this stuff :dealThanks for the referral, Andy, much obliged:-)
spockling
Mar-23-2005, 06:32 AM
Nikolai, because Canon cameras add dirs on the cf card after so many pics, how can the set src dir line be changed to accomodate that problem? Is there a wildcard or a switch that can be added to that line?
Thanks again
Nikolai
Mar-23-2005, 06:48 AM
Nikolai, because Canon cameras add dirs on the cf card after so many pics, how can the set src dir line be changed to accomodate that problem? Is there a wildcard or a switch that can be added to that line?
Thanks againIf you know the dir naming pattern and it's simple enough (like folder1, folder2, etc) you can wrap the whole thing into another for-loop.
You can check directory existence via
if [not] exist YOUR_DIR\nul
If it is not that simple and you only know the location (or even need to ask for it), you have to go with more complex solution.
VBS (or JS, for that matter) can take you a bit farher. Complete refererence on Windows scripting can be found at this msdn location (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp). Pay especial attention to the file system object of the script runtime (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsobjfilesystem.asp), that's where you can enumerate all the folders and copy files. They have plenty of examples, if you did any basic scripting before you'll find it very easy to follow..
HTH
Nik
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.