Benny Pedersen
August 23rd, 2006, 09:46 PM
This little program is figured out yesterday and updated today.
Let say that you have a folder with RAW files that you want
to be opened in PE but with the same WhiteBalance or whatever.
Drag and drop a RAW file onto this CMD file and the RAW file would be opened in PE as specified. The RAW file is not modified, so just read this code or/and experiment... :)
Benny
Open.CMD (Maybe under construction)
@echo off&color F0&setlocal enableextensions enabledelayedexpansion&rem DOS Batch file by Benny Pedersen
::
:: Drag and drop a RAW file "P\N.X" (path(P)\base(N).extension(X)).
:: To be sure the Camera RAW Database is not used, you could
:: either write protect, delete or rename the database.
:: One XMP template file is used "(P)\(N).xmp".
:: If the XMP file is not found, any first (random) found template XMP file
:: would be removed/taken in P, else used, otherwise created (read-only).
::
set p=C:\Program Files\Adobe\Photoshop Elements 4.0\Photoshop Elements 4.0.exe
if not exist "%p%" (
set p=%ProgramFiles%%p:~16%
if not exist "!p!" (
echo %p%&echo.
echo OOPS: PhotoshopE not found. You should modify "%~nx0", ^(Line numb 10^)
echo -----&echo QUIT:&pause&goto:end
))
if not exist "%~dpnx1" (
echo.&echo OOPS: You forgot to Drag ^& Drop a RAW file :-^)
echo -----&echo QUIT:&pause&goto:end
)
if exist "%~dpn1.xmp" goto:p
(set CtrlStrng=Benny Pedersen. http://hjem.get2net.dk/b_pedersen/gallery)
for /r "%~dp1" %%f in (*.xmp) do (
call:IsTemplateXMP " %CtrlStrng% " "%%~ff"
if defined IsTemplateXMP move "%%~ff" "%~dpn1.xmp"
if exist "%~dpn1.xmp" goto:p
)
:db
cls&echo.&set crdP=%appdata%\Adobe\CameraRaw
if exist "%crdP%\Database" (
echo. What to do with Adobe
echo. Camera RAW Database ?
echo.&echo. 1. Write Protect
echo.&echo. 2. - Unprotect
echo.&echo. 3. Delete
echo.&echo. 4. Open folder
echo.&echo. 5. Nothing
echo.&set /p answer= Input a number: % %
if "!answer!" == "1" attrib +r "%crdP%\Database"&goto:db_out
if "!answer!" == "2" attrib -r "%crdP%\Database"&goto:db_out
if "!answer!" == "3" echo.&del /p "%crdP%\Database"&goto:db
if "!answer!" == "4" explorer "%crdP%"&echo.&echo Activate this window, then:&pause&goto:db
if not "!answer!" == "5" goto:db
)
:db_out
echo ^<^^!-- %CtrlStrng% --^>> "%~dpn1.xmp"
findstr /B "<rdf <crs </rdf <^!" %~sf0 >> "%~dpn1.xmp"
attrib +r "%~dpn1.xmp"
:p
"%p%" "%~dpnx1"
goto:end
:IsTemplateXMP
(set IsTemplateXMP=)
for /f "usebackq tokens=1 delims=<!--" %%f in (%2) do (
if %1 == "%%f" (set IsTemplateXMP=1)
goto:eof
)
goto:eof
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
<!-- WhiteBalance As Shot -->
<!-- Auto -->
<!-- Tungsten (2850 0) -->
<!-- Fluorescent (3800 +21) -->
<!-- Flash (5500 0) -->
<!-- Daylight (5500 +10) -->
<!-- Cloudy (6500 +10) -->
<!-- Shade (7500 +10) -->
<!-- Custom -->
<crs:WhiteBalance>As Shot</crs:WhiteBalance>
<!-- Temperature 2000 ... 50000 and WhiteBalance Custom -->
<crs:Temperature>6050</crs:Temperature>
<!-- Tint -150 ... +150 and WhiteBalance Custom -->
<crs:Tint>+5</crs:Tint>
<!-- Exposure -4.00 ... +4.00 and AutoExposure False -->
<crs:Exposure>-0.50</crs:Exposure>
<crs:AutoExposure>False</crs:AutoExposure>
<!-- Shadows 0 ... 100 and AutoShadows False -->
<crs:Shadows>3</crs:Shadows>
<crs:AutoShadows>False</crs:AutoShadows>
<!-- Brightness 0 ... 150 and AutoBrightness False -->
<crs:Brightness>32</crs:Brightness>
<crs:AutoBrightness>False</crs:AutoBrightness>
<!-- Contrast -50 ... +100 and AutoContrast False -->
<crs:Contrast>+22</crs:Contrast>
<crs:AutoContrast>True</crs:AutoContrast>
<!-- Saturation -100 ... +100 -->
<crs:Saturation>0</crs:Saturation>
<!-- Sharpness 0 ... 100 -->
<crs:Sharpness>26</crs:Sharpness>
<crs:LuminanceSmoothing>0</crs:LuminanceSmoothing>
<crs:ColorNoiseReduction>0</crs:ColorNoiseReduction>
</rdf:Description></rdf:RDF>
:end
endlocal
Let say that you have a folder with RAW files that you want
to be opened in PE but with the same WhiteBalance or whatever.
Drag and drop a RAW file onto this CMD file and the RAW file would be opened in PE as specified. The RAW file is not modified, so just read this code or/and experiment... :)
Benny
Open.CMD (Maybe under construction)
@echo off&color F0&setlocal enableextensions enabledelayedexpansion&rem DOS Batch file by Benny Pedersen
::
:: Drag and drop a RAW file "P\N.X" (path(P)\base(N).extension(X)).
:: To be sure the Camera RAW Database is not used, you could
:: either write protect, delete or rename the database.
:: One XMP template file is used "(P)\(N).xmp".
:: If the XMP file is not found, any first (random) found template XMP file
:: would be removed/taken in P, else used, otherwise created (read-only).
::
set p=C:\Program Files\Adobe\Photoshop Elements 4.0\Photoshop Elements 4.0.exe
if not exist "%p%" (
set p=%ProgramFiles%%p:~16%
if not exist "!p!" (
echo %p%&echo.
echo OOPS: PhotoshopE not found. You should modify "%~nx0", ^(Line numb 10^)
echo -----&echo QUIT:&pause&goto:end
))
if not exist "%~dpnx1" (
echo.&echo OOPS: You forgot to Drag ^& Drop a RAW file :-^)
echo -----&echo QUIT:&pause&goto:end
)
if exist "%~dpn1.xmp" goto:p
(set CtrlStrng=Benny Pedersen. http://hjem.get2net.dk/b_pedersen/gallery)
for /r "%~dp1" %%f in (*.xmp) do (
call:IsTemplateXMP " %CtrlStrng% " "%%~ff"
if defined IsTemplateXMP move "%%~ff" "%~dpn1.xmp"
if exist "%~dpn1.xmp" goto:p
)
:db
cls&echo.&set crdP=%appdata%\Adobe\CameraRaw
if exist "%crdP%\Database" (
echo. What to do with Adobe
echo. Camera RAW Database ?
echo.&echo. 1. Write Protect
echo.&echo. 2. - Unprotect
echo.&echo. 3. Delete
echo.&echo. 4. Open folder
echo.&echo. 5. Nothing
echo.&set /p answer= Input a number: % %
if "!answer!" == "1" attrib +r "%crdP%\Database"&goto:db_out
if "!answer!" == "2" attrib -r "%crdP%\Database"&goto:db_out
if "!answer!" == "3" echo.&del /p "%crdP%\Database"&goto:db
if "!answer!" == "4" explorer "%crdP%"&echo.&echo Activate this window, then:&pause&goto:db
if not "!answer!" == "5" goto:db
)
:db_out
echo ^<^^!-- %CtrlStrng% --^>> "%~dpn1.xmp"
findstr /B "<rdf <crs </rdf <^!" %~sf0 >> "%~dpn1.xmp"
attrib +r "%~dpn1.xmp"
:p
"%p%" "%~dpnx1"
goto:end
:IsTemplateXMP
(set IsTemplateXMP=)
for /f "usebackq tokens=1 delims=<!--" %%f in (%2) do (
if %1 == "%%f" (set IsTemplateXMP=1)
goto:eof
)
goto:eof
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
<!-- WhiteBalance As Shot -->
<!-- Auto -->
<!-- Tungsten (2850 0) -->
<!-- Fluorescent (3800 +21) -->
<!-- Flash (5500 0) -->
<!-- Daylight (5500 +10) -->
<!-- Cloudy (6500 +10) -->
<!-- Shade (7500 +10) -->
<!-- Custom -->
<crs:WhiteBalance>As Shot</crs:WhiteBalance>
<!-- Temperature 2000 ... 50000 and WhiteBalance Custom -->
<crs:Temperature>6050</crs:Temperature>
<!-- Tint -150 ... +150 and WhiteBalance Custom -->
<crs:Tint>+5</crs:Tint>
<!-- Exposure -4.00 ... +4.00 and AutoExposure False -->
<crs:Exposure>-0.50</crs:Exposure>
<crs:AutoExposure>False</crs:AutoExposure>
<!-- Shadows 0 ... 100 and AutoShadows False -->
<crs:Shadows>3</crs:Shadows>
<crs:AutoShadows>False</crs:AutoShadows>
<!-- Brightness 0 ... 150 and AutoBrightness False -->
<crs:Brightness>32</crs:Brightness>
<crs:AutoBrightness>False</crs:AutoBrightness>
<!-- Contrast -50 ... +100 and AutoContrast False -->
<crs:Contrast>+22</crs:Contrast>
<crs:AutoContrast>True</crs:AutoContrast>
<!-- Saturation -100 ... +100 -->
<crs:Saturation>0</crs:Saturation>
<!-- Sharpness 0 ... 100 -->
<crs:Sharpness>26</crs:Sharpness>
<crs:LuminanceSmoothing>0</crs:LuminanceSmoothing>
<crs:ColorNoiseReduction>0</crs:ColorNoiseReduction>
</rdf:Description></rdf:RDF>
:end
endlocal