用于批量编辑和应用不同 ACR 的 Javascript Actionscript |

我有用于批量编辑照片的静态文件夹位置(~桌面/新文件夹)。我在这个文件夹中有一些照片和相机原始设置文件 (*.xmp)。我必须使用 CameraRAW 设置文件一张一张地编辑我的照片,可能是这样的:


Photo 1.jpg -> apply Setting 1.xmp;

Photo 2.jpg -> apply Setting 2.xmp;

Photo 3.jpg -> apply Setting 3.xmp;

Photo 4.jpg -> apply Setting 4.xmp;

Photo 5.jpg -> apply Setting 5.xmp;

...

...

同一文件夹中的所有照片和设置。它可以像 Photoshop 中使用 javascript /jsx 的批量图像编辑操作一样自动处理吗?,


非常感谢你的帮助。


缥缈止盈
浏览 116回答 1
1回答

小怪兽爱吃肉

我认为有可能,但看起来 Camera Raw 滤镜无法通过通常的方式访问activeDocument.activeLayer.applyCameraRaw(settings1, setting2...)我认为您可以指定一个明确的 XMP,但它们似乎是由从 XMP 文件 9 中获取的唯一 ID 引用的 crs:UUID="A9A83D3876A04E49B36071604D357846")scriptListener 代码真的很难看。看看你自己:// =======================================================var idAdobeCameraRawFilter = stringIDToTypeID( "Adobe Camera Raw Filter" );&nbsp; var desc8 = new ActionDescriptor();&nbsp; var idCMod = charIDToTypeID( "CMod" );&nbsp; desc8.putString( idCMod, """Filter""" );&nbsp; var idSett = charIDToTypeID( "Sett" );&nbsp; var idSett = charIDToTypeID( "Sett" );&nbsp; var idCst = charIDToTypeID( "Cst " );&nbsp; desc8.putEnumerated( idSett, idSett, idCst );&nbsp; var idWBal = charIDToTypeID( "WBal" );&nbsp; var idWBal = charIDToTypeID( "WBal" );&nbsp; var idAsSh = charIDToTypeID( "AsSh" );&nbsp; desc8.putEnumerated( idWBal, idWBal, idAsSh );&nbsp; var idTemp = charIDToTypeID( "Temp" );&nbsp; desc8.putInteger( idTemp, 0 );&nbsp; var idTint = charIDToTypeID( "Tint" );&nbsp; desc8.putInteger( idTint, 0 );&nbsp; var idCtoG = charIDToTypeID( "CtoG" );&nbsp; desc8.putBoolean( idCtoG, false );&nbsp; var idStrt = charIDToTypeID( "Strt" );&nbsp; desc8.putInteger( idStrt, 0 );&nbsp; var idShrp = charIDToTypeID( "Shrp" );&nbsp; desc8.putInteger( idShrp, 0 );&nbsp; var idLNR = charIDToTypeID( "LNR " );&nbsp; desc8.putInteger( idLNR, 0 );&nbsp; var idCNR = charIDToTypeID( "CNR " );&nbsp; desc8.putInteger( idCNR, 0 );&nbsp; var idVigA = charIDToTypeID( "VigA" );&nbsp; desc8.putInteger( idVigA, 0 );&nbsp; var idBlkB = charIDToTypeID( "BlkB" );&nbsp; desc8.putInteger( idBlkB, 0 );&nbsp; var idRHue = charIDToTypeID( "RHue" );&nbsp; desc8.putInteger( idRHue, 0 );&nbsp; var idRSat = charIDToTypeID( "RSat" );&nbsp; desc8.putInteger( idRSat, 0 );&nbsp; var idGHue = charIDToTypeID( "GHue" );&nbsp; desc8.putInteger( idGHue, 0 );&nbsp; var idGSat = charIDToTypeID( "GSat" );&nbsp; desc8.putInteger( idGSat, 0 );&nbsp; var idBHue = charIDToTypeID( "BHue" );&nbsp; desc8.putInteger( idBHue, 0 );&nbsp; var idBSat = charIDToTypeID( "BSat" );&nbsp; desc8.putInteger( idBSat, 0 );&nbsp; var idVibr = charIDToTypeID( "Vibr" );&nbsp; desc8.putInteger( idVibr, 0 );&nbsp; var idHA_R = charIDToTypeID( "HA_R" );&nbsp; desc8.putInteger( idHA_R, 0 );&nbsp; var idHA_O = charIDToTypeID( "HA_O" );&nbsp; desc8.putInteger( idHA_O, 0 );&nbsp; var idHA_Y = charIDToTypeID( "HA_Y" );&nbsp; desc8.putInteger( idHA_Y, 0 );&nbsp; var idHA_G = charIDToTypeID( "HA_G" );&nbsp; desc8.putInteger( idHA_G, 0 );&nbsp; var idHA_A = charIDToTypeID( "HA_A" );&nbsp; desc8.putInteger( idHA_A, 0 );&nbsp; var idHA_B = charIDToTypeID( "HA_B" );&nbsp; desc8.putInteger( idHA_B, 0 );&nbsp; var idHA_P = charIDToTypeID( "HA_P" );&nbsp; desc8.putInteger( idHA_P, 0 );&nbsp; var idHA_M = charIDToTypeID( "HA_M" );&nbsp; desc8.putInteger( idHA_M, 0 );&nbsp; var idSA_R = charIDToTypeID( "SA_R" );&nbsp; desc8.putInteger( idSA_R, 0 );&nbsp; var idSA_O = charIDToTypeID( "SA_O" );&nbsp; desc8.putInteger( idSA_O, 0 );&nbsp; var idSA_Y = charIDToTypeID( "SA_Y" );&nbsp; desc8.putInteger( idSA_Y, 0 );&nbsp; var idSA_G = charIDToTypeID( "SA_G" );&nbsp; desc8.putInteger( idSA_G, 0 );&nbsp; var idSA_A = charIDToTypeID( "SA_A" );&nbsp; desc8.putInteger( idSA_A, 0 );&nbsp; var idSA_B = charIDToTypeID( "SA_B" );&nbsp; desc8.putInteger( idSA_B, 0 );&nbsp; var idSA_P = charIDToTypeID( "SA_P" );&nbsp; desc8.putInteger( idSA_P, 0 );&nbsp; var idSA_M = charIDToTypeID( "SA_M" );&nbsp; desc8.putInteger( idSA_M, 0 );&nbsp; var idLA_R = charIDToTypeID( "LA_R" );&nbsp; desc8.putInteger( idLA_R, 0 );&nbsp; var idLA_O = charIDToTypeID( "LA_O" );&nbsp; desc8.putInteger( idLA_O, 0 );&nbsp; var idLA_Y = charIDToTypeID( "LA_Y" );&nbsp; desc8.putInteger( idLA_Y, 0 );&nbsp; var idLA_G = charIDToTypeID( "LA_G" );&nbsp; desc8.putInteger( idLA_G, 0 );&nbsp; var idLA_A = charIDToTypeID( "LA_A" );&nbsp; desc8.putInteger( idLA_A, 0 );&nbsp; var idLA_B = charIDToTypeID( "LA_B" );&nbsp; desc8.putInteger( idLA_B, 0 );&nbsp; var idLA_P = charIDToTypeID( "LA_P" );&nbsp; desc8.putInteger( idLA_P, 0 );&nbsp; var idLA_M = charIDToTypeID( "LA_M" );&nbsp; desc8.putInteger( idLA_M, 0 );&nbsp; var idSTSH = charIDToTypeID( "STSH" );&nbsp; desc8.putInteger( idSTSH, 0 );&nbsp; var idSTSS = charIDToTypeID( "STSS" );&nbsp; desc8.putInteger( idSTSS, 0 );&nbsp; var idSTHH = charIDToTypeID( "STHH" );&nbsp; desc8.putInteger( idSTHH, 0 );&nbsp; var idSTHS = charIDToTypeID( "STHS" );&nbsp; desc8.putInteger( idSTHS, 0 );&nbsp; var idSTB = charIDToTypeID( "STB " );&nbsp; desc8.putInteger( idSTB, 0 );&nbsp; var idPC_S = charIDToTypeID( "PC_S" );&nbsp; desc8.putInteger( idPC_S, 0 );&nbsp; var idPC_D = charIDToTypeID( "PC_D" );&nbsp; desc8.putInteger( idPC_D, 0 );&nbsp; var idPC_L = charIDToTypeID( "PC_L" );&nbsp; desc8.putInteger( idPC_L, 0 );&nbsp; var idPC_H = charIDToTypeID( "PC_H" );&nbsp; desc8.putInteger( idPC_H, 0 );&nbsp; var idPC_one = charIDToTypeID( "PC_1" );&nbsp; desc8.putInteger( idPC_one, 25 );&nbsp; var idPC_two = charIDToTypeID( "PC_2" );&nbsp; desc8.putInteger( idPC_two, 50 );&nbsp; var idPC_three = charIDToTypeID( "PC_3" );&nbsp; desc8.putInteger( idPC_three, 75 );&nbsp; var idShpR = charIDToTypeID( "ShpR" );&nbsp; desc8.putDouble( idShpR, 1.000000 );&nbsp; var idShpD = charIDToTypeID( "ShpD" );&nbsp; desc8.putInteger( idShpD, 25 );&nbsp; var idShpM = charIDToTypeID( "ShpM" );&nbsp; desc8.putInteger( idShpM, 0 );&nbsp; var idPCVA = charIDToTypeID( "PCVA" );&nbsp; desc8.putInteger( idPCVA, 0 );&nbsp; var idGRNA = charIDToTypeID( "GRNA" );&nbsp; desc8.putInteger( idGRNA, 0 );&nbsp; var idLPEn = charIDToTypeID( "LPEn" );&nbsp; desc8.putInteger( idLPEn, 0 );&nbsp; var idMDis = charIDToTypeID( "MDis" );&nbsp; desc8.putInteger( idMDis, 0 );&nbsp; var idPerV = charIDToTypeID( "PerV" );&nbsp; desc8.putInteger( idPerV, 0 );&nbsp; var idPerH = charIDToTypeID( "PerH" );&nbsp; desc8.putInteger( idPerH, 0 );&nbsp; var idPerR = charIDToTypeID( "PerR" );&nbsp; desc8.putDouble( idPerR, 0.000000 );&nbsp; var idPerS = charIDToTypeID( "PerS" );&nbsp; desc8.putInteger( idPerS, 100 );&nbsp; var idPerA = charIDToTypeID( "PerA" );&nbsp; desc8.putInteger( idPerA, 0 );&nbsp; var idPerU = charIDToTypeID( "PerU" );&nbsp; desc8.putInteger( idPerU, 0 );&nbsp; var idPerX = charIDToTypeID( "PerX" );&nbsp; desc8.putDouble( idPerX, 0.000000 );&nbsp; var idPerY = charIDToTypeID( "PerY" );&nbsp; desc8.putDouble( idPerY, 0.000000 );&nbsp; var idAuCA = charIDToTypeID( "AuCA" );&nbsp; desc8.putInteger( idAuCA, 0 );&nbsp; var idExonetwo = charIDToTypeID( "Ex12" );&nbsp; desc8.putDouble( idExonetwo, 0.000000 );&nbsp; var idCronetwo = charIDToTypeID( "Cr12" );&nbsp; desc8.putInteger( idCronetwo, 0 );&nbsp; var idHionetwo = charIDToTypeID( "Hi12" );&nbsp; desc8.putInteger( idHionetwo, 0 );&nbsp; var idShonetwo = charIDToTypeID( "Sh12" );&nbsp; desc8.putInteger( idShonetwo, 0 );&nbsp; var idWhonetwo = charIDToTypeID( "Wh12" );&nbsp; desc8.putInteger( idWhonetwo, 30 );&nbsp; var idBkonetwo = charIDToTypeID( "Bk12" );&nbsp; desc8.putInteger( idBkonetwo, -30 );&nbsp; var idClonetwo = charIDToTypeID( "Cl12" );&nbsp; desc8.putInteger( idClonetwo, 0 );&nbsp; var idDfPA = charIDToTypeID( "DfPA" );&nbsp; desc8.putInteger( idDfPA, 0 );&nbsp; var idDPHL = charIDToTypeID( "DPHL" );&nbsp; desc8.putInteger( idDPHL, 30 );&nbsp; var idDPHH = charIDToTypeID( "DPHH" );&nbsp; desc8.putInteger( idDPHH, 70 );&nbsp; var idDfGA = charIDToTypeID( "DfGA" );&nbsp; desc8.putInteger( idDfGA, 0 );&nbsp; var idDPGL = charIDToTypeID( "DPGL" );&nbsp; desc8.putInteger( idDPGL, 40 );&nbsp; var idDPGH = charIDToTypeID( "DPGH" );&nbsp; desc8.putInteger( idDPGH, 60 );&nbsp; var idDhze = charIDToTypeID( "Dhze" );&nbsp; desc8.putInteger( idDhze, 0 );&nbsp; var idTMMs = charIDToTypeID( "TMMs" );&nbsp; desc8.putInteger( idTMMs, 0 );&nbsp; var idCrv = charIDToTypeID( "Crv " );&nbsp; &nbsp; &nbsp; var list1 = new ActionList();&nbsp; &nbsp; &nbsp; list1.putInteger( 0 );&nbsp; &nbsp; &nbsp; list1.putInteger( 0 );&nbsp; &nbsp; &nbsp; list1.putInteger( 255 );&nbsp; &nbsp; &nbsp; list1.putInteger( 255 );&nbsp; desc8.putList( idCrv, list1 );&nbsp; var idCrvR = charIDToTypeID( "CrvR" );&nbsp; &nbsp; &nbsp; var list2 = new ActionList();&nbsp; &nbsp; &nbsp; list2.putInteger( 0 );&nbsp; &nbsp; &nbsp; list2.putInteger( 0 );&nbsp; &nbsp; &nbsp; list2.putInteger( 255 );&nbsp; &nbsp; &nbsp; list2.putInteger( 255 );&nbsp; desc8.putList( idCrvR, list2 );&nbsp; var idCrvG = charIDToTypeID( "CrvG" );&nbsp; &nbsp; &nbsp; var list3 = new ActionList();&nbsp; &nbsp; &nbsp; list3.putInteger( 0 );&nbsp; &nbsp; &nbsp; list3.putInteger( 0 );&nbsp; &nbsp; &nbsp; list3.putInteger( 255 );&nbsp; &nbsp; &nbsp; list3.putInteger( 255 );&nbsp; desc8.putList( idCrvG, list3 );&nbsp; var idCrvB = charIDToTypeID( "CrvB" );&nbsp; &nbsp; &nbsp; var list4 = new ActionList();&nbsp; &nbsp; &nbsp; list4.putInteger( 0 );&nbsp; &nbsp; &nbsp; list4.putInteger( 0 );&nbsp; &nbsp; &nbsp; list4.putInteger( 255 );&nbsp; &nbsp; &nbsp; list4.putInteger( 255 );&nbsp; desc8.putList( idCrvB, list4 );&nbsp; var idCamP = charIDToTypeID( "CamP" );&nbsp; desc8.putString( idCamP, """Embedded""" );&nbsp; var idCP_D = charIDToTypeID( "CP_D" );&nbsp; desc8.putString( idCP_D, """54650A341B5B5CCAE8442D0B43A92BCE""" );&nbsp; var idPrVe = charIDToTypeID( "PrVe" );&nbsp; desc8.putInteger( idPrVe, 167772160 );&nbsp; var idRtch = charIDToTypeID( "Rtch" );&nbsp; desc8.putString( idRtch, """""" );&nbsp; var idREye = charIDToTypeID( "REye" );&nbsp; desc8.putString( idREye, """""" );&nbsp; var idLCs = charIDToTypeID( "LCs " );&nbsp; desc8.putString( idLCs, """""" );&nbsp; var idUpri = charIDToTypeID( "Upri" );&nbsp; desc8.putString( idUpri, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21&nbsp; &nbsp; &nbsp; &nbsp; "><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about=""&nbsp; xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"&nbsp;crs:UprightVersion="151388160"&nbsp;crs:UprightCenterMode="0"&nbsp;crs:UprightCenterNormX="0.5"&nbsp;crs:UprightCenterNormY="0.5"&nbsp;crs:UprightFocalMode="0"&nbsp;crs:UprightFocalLength35mm="35"&nbsp;crs:UprightPreview="False"&nbsp;crs:UprightTransformCount="6"/></rdf:RDF></x:xmpmeta>""" );&nbsp; var idGuUr = charIDToTypeID( "GuUr" );&nbsp; desc8.putString( idGuUr, """""" );&nbsp; var idLook = charIDToTypeID( "Look" );&nbsp; desc8.putString( idLook, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21&nbsp; &nbsp; &nbsp; &nbsp; "><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about=""&nbsp; xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">&nbsp;<crs:Look>&nbsp; <rdf:Description&nbsp; &nbsp;crs:Name="B&amp;W 03"&nbsp; &nbsp;crs:Amount="1.000000"&nbsp; &nbsp;crs:Cluster="Adobe"&nbsp; &nbsp;crs:UUID="ADB81986EAF84E0999C0112BDE1F93D1"&nbsp; &nbsp;crs:SupportsMonochrome="false"&nbsp; &nbsp;crs:Copyright="© 2018 Adobe Systems, Inc."&nbsp; &nbsp;crs:Stubbed="true">&nbsp; <crs:SortName>&nbsp; &nbsp;<rdf:Alt>&nbsp; &nbsp; <rdf:li xml:lang="x-default">B&amp;W 03</rdf:li>&nbsp; &nbsp;</rdf:Alt>&nbsp; </crs:SortName>&nbsp; <crs:Group>&nbsp; &nbsp;<rdf:Alt>&nbsp; &nbsp; <rdf:li xml:lang="x-default">B&amp;W</rdf:li>&nbsp; &nbsp;</rdf:Alt>&nbsp; </crs:Group>&nbsp; </rdf:Description>&nbsp;</crs:Look></rdf:Description></rdf:RDF></x:xmpmeta>""" );&nbsp; var idPset = charIDToTypeID( "Pset" );&nbsp; desc8.putString( idPset, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21&nbsp; &nbsp; &nbsp; &nbsp; "><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about=""&nbsp; xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">&nbsp;<crs:Preset>&nbsp; <rdf:Description&nbsp; &nbsp;crs:Name="B&amp;W High Contrast"&nbsp; &nbsp;crs:Amount="1.000000"&nbsp; &nbsp;crs:Cluster="Adobe 1.3"&nbsp; &nbsp;crs:UUID="A9A83D3876A04E49B36071604D357846"&nbsp; &nbsp;crs:SupportsMonochrome="false"&nbsp; &nbsp;crs:LookAmount="1.000000">&nbsp; <crs:Group>&nbsp; &nbsp;<rdf:Alt>&nbsp; &nbsp; <rdf:li xml:lang="x-default">B&amp;W</rdf:li>&nbsp; &nbsp;</rdf:Alt>&nbsp; </crs:Group>&nbsp; <crs:Parameters>&nbsp; &nbsp;<rdf:Description&nbsp; &nbsp; crs:Version="10.5"&nbsp; &nbsp; crs:ProcessVersion="10.0"&nbsp; &nbsp; crs:SplitToningShadowHue="0"&nbsp; &nbsp; crs:SplitToningShadowSaturation="0"&nbsp; &nbsp; crs:SplitToningHighlightHue="0"&nbsp; &nbsp; crs:SplitToningHighlightSaturation="0"&nbsp; &nbsp; crs:SplitToningBalance="0"&nbsp; &nbsp; crs:Whites2012="+30"&nbsp; &nbsp; crs:Blacks2012="-30"&nbsp; &nbsp; crs:Clarity2012="0"&nbsp; &nbsp; crs:Dehaze="0"&nbsp; &nbsp; crs:ToneCurveName2012="Linear">&nbsp; &nbsp;<crs:ToneCurvePV2012>&nbsp; &nbsp; <rdf:Seq>&nbsp; &nbsp; &nbsp;<rdf:li>0, 0</rdf:li>&nbsp; &nbsp; &nbsp;<rdf:li>255, 255</rdf:li>&nbsp; &nbsp; </rdf:Seq>&nbsp; &nbsp;</crs:ToneCurvePV2012>&nbsp; &nbsp;<crs:ToneCurvePV2012Red>&nbsp; &nbsp; <rdf:Seq>&nbsp; &nbsp; &nbsp;<rdf:li>0, 0</rdf:li>&nbsp; &nbsp; &nbsp;<rdf:li>255, 255</rdf:li>&nbsp; &nbsp; </rdf:Seq>&nbsp; &nbsp;</crs:ToneCurvePV2012Red>&nbsp; &nbsp;<crs:ToneCurvePV2012Green>&nbsp; &nbsp; <rdf:Seq>&nbsp; &nbsp; &nbsp;<rdf:li>0, 0</rdf:li>&nbsp; &nbsp; &nbsp;<rdf:li>255, 255</rdf:li>&nbsp; &nbsp; </rdf:Seq>&nbsp; &nbsp;</crs:ToneCurvePV2012Green>&nbsp; &nbsp;<crs:ToneCurvePV2012Blue>&nbsp; &nbsp; <rdf:Seq>&nbsp; &nbsp; &nbsp;<rdf:li>0, 0</rdf:li>&nbsp; &nbsp; &nbsp;<rdf:li>255, 255</rdf:li>&nbsp; &nbsp; </rdf:Seq>&nbsp; &nbsp;</crs:ToneCurvePV2012Blue>&nbsp; &nbsp;</rdf:Description>&nbsp; </crs:Parameters>&nbsp; </rdf:Description>&nbsp;</crs:Preset></rdf:Description></rdf:RDF></x:xmpmeta>""" );executeAction( idAdobeCameraRawFilter, desc8, DialogModes.NO );我认为,在这种情况下,为每个设置录制一个动作可能是您最好的选择。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript