Copy link to clipboard
Copied
Hello everyone,
I have a NEF file on my computer that I would like to open asSmartObject so I would be able to edit properly.
here is the file:
If I open this file normally on Photoshop it will open in Camera Raw. Now near the bottom of the screen you'll see "Open Image".
If I hold the shift key I will see "Open Object". The end result is a smart object that by opening it I can edit the contents in Camera Raw.
I want to script this: opening this file as smart object, here are some pictures for this process.
1 Correct answer
open(file, OpenDocumentType.CAMERARAW, true);
or
open(file, new CameraRAWOpenOptions(), true);
Explore related tutorials & articles
Copy link to clipboard
Copied
I used ScriptListener and it works, but the script is so long and I believe there's a better way to do this.
function OpenNEF_asSmartObject(NEFFile)
{
// =======================================================
var idOpn = charIDToTypeID( "Opn " );
var desc5 = new ActionDescriptor();
var iddontRecord = stringIDToTypeID( "dontRecord" );
desc5.putBoolean( iddontRecord, false );
var idforceNotify = stringIDToTypeID( "forceNotify" );
desc5.putBoolean( idforceNotify, true );
var idnull = charIDToTypeID( "null" );
desc5.putPath( idnull, new File(NEFFile) );
var idAs = charIDToTypeID( "As " );
var desc6 = new ActionDescriptor();
var idCMod = charIDToTypeID( "CMod" );
desc6.putString( idCMod, """Nikon D5300""" );
var idSett = charIDToTypeID( "Sett" );
var idSett = charIDToTypeID( "Sett" );
var idCst = charIDToTypeID( "Cst " );
desc6.putEnumerated( idSett, idSett, idCst );
var idWBal = charIDToTypeID( "WBal" );
var idWBal = charIDToTypeID( "WBal" );
var idCst = charIDToTypeID( "Cst " );
desc6.putEnumerated( idWBal, idWBal, idCst );
var idTemp = charIDToTypeID( "Temp" );
desc6.putInteger( idTemp, 5200 );
var idTint = charIDToTypeID( "Tint" );
desc6.putInteger( idTint, 2 );
var idCtoG = charIDToTypeID( "CtoG" );
desc6.putBoolean( idCtoG, false );
var idStrt = charIDToTypeID( "Strt" );
desc6.putInteger( idStrt, -18 );
var idShrp = charIDToTypeID( "Shrp" );
desc6.putInteger( idShrp, 40 );
var idLNR = charIDToTypeID( "LNR " );
desc6.putInteger( idLNR, 0 );
var idCNR = charIDToTypeID( "CNR " );
desc6.putInteger( idCNR, 25 );
var idVigA = charIDToTypeID( "VigA" );
desc6.putInteger( idVigA, 0 );
var idBlkB = charIDToTypeID( "BlkB" );
desc6.putInteger( idBlkB, 0 );
var idRHue = charIDToTypeID( "RHue" );
desc6.putInteger( idRHue, 0 );
var idRSat = charIDToTypeID( "RSat" );
desc6.putInteger( idRSat, 0 );
var idGHue = charIDToTypeID( "GHue" );
desc6.putInteger( idGHue, 0 );
var idGSat = charIDToTypeID( "GSat" );
desc6.putInteger( idGSat, 0 );
var idBHue = charIDToTypeID( "BHue" );
desc6.putInteger( idBHue, 0 );
var idBSat = charIDToTypeID( "BSat" );
desc6.putInteger( idBSat, 0 );
var idVibr = charIDToTypeID( "Vibr" );
desc6.putInteger( idVibr, 0 );
var idHA_R = charIDToTypeID( "HA_R" );
desc6.putInteger( idHA_R, 0 );
var idHA_O = charIDToTypeID( "HA_O" );
desc6.putInteger( idHA_O, 0 );
var idHA_Y = charIDToTypeID( "HA_Y" );
desc6.putInteger( idHA_Y, 0 );
var idHA_G = charIDToTypeID( "HA_G" );
desc6.putInteger( idHA_G, 0 );
var idHA_A = charIDToTypeID( "HA_A" );
desc6.putInteger( idHA_A, 0 );
var idHA_B = charIDToTypeID( "HA_B" );
desc6.putInteger( idHA_B, 0 );
var idHA_P = charIDToTypeID( "HA_P" );
desc6.putInteger( idHA_P, 0 );
var idHA_M = charIDToTypeID( "HA_M" );
desc6.putInteger( idHA_M, 0 );
var idSA_R = charIDToTypeID( "SA_R" );
desc6.putInteger( idSA_R, 0 );
var idSA_O = charIDToTypeID( "SA_O" );
desc6.putInteger( idSA_O, 0 );
var idSA_Y = charIDToTypeID( "SA_Y" );
desc6.putInteger( idSA_Y, 0 );
var idSA_G = charIDToTypeID( "SA_G" );
desc6.putInteger( idSA_G, 0 );
var idSA_A = charIDToTypeID( "SA_A" );
desc6.putInteger( idSA_A, 0 );
var idSA_B = charIDToTypeID( "SA_B" );
desc6.putInteger( idSA_B, 0 );
var idSA_P = charIDToTypeID( "SA_P" );
desc6.putInteger( idSA_P, 0 );
var idSA_M = charIDToTypeID( "SA_M" );
desc6.putInteger( idSA_M, 0 );
var idLA_R = charIDToTypeID( "LA_R" );
desc6.putInteger( idLA_R, 0 );
var idLA_O = charIDToTypeID( "LA_O" );
desc6.putInteger( idLA_O, 0 );
var idLA_Y = charIDToTypeID( "LA_Y" );
desc6.putInteger( idLA_Y, 0 );
var idLA_G = charIDToTypeID( "LA_G" );
desc6.putInteger( idLA_G, 0 );
var idLA_A = charIDToTypeID( "LA_A" );
desc6.putInteger( idLA_A, 0 );
var idLA_B = charIDToTypeID( "LA_B" );
desc6.putInteger( idLA_B, 0 );
var idLA_P = charIDToTypeID( "LA_P" );
desc6.putInteger( idLA_P, 0 );
var idLA_M = charIDToTypeID( "LA_M" );
desc6.putInteger( idLA_M, 0 );
var idSTSH = charIDToTypeID( "STSH" );
desc6.putInteger( idSTSH, 0 );
var idSTSS = charIDToTypeID( "STSS" );
desc6.putInteger( idSTSS, 0 );
var idSTHH = charIDToTypeID( "STHH" );
desc6.putInteger( idSTHH, 0 );
var idSTHS = charIDToTypeID( "STHS" );
desc6.putInteger( idSTHS, 0 );
var idSTB = charIDToTypeID( "STB " );
desc6.putInteger( idSTB, 0 );
var idPC_S = charIDToTypeID( "PC_S" );
desc6.putInteger( idPC_S, 0 );
var idPC_D = charIDToTypeID( "PC_D" );
desc6.putInteger( idPC_D, 0 );
var idPC_L = charIDToTypeID( "PC_L" );
desc6.putInteger( idPC_L, 0 );
var idPC_H = charIDToTypeID( "PC_H" );
desc6.putInteger( idPC_H, 0 );
var idPC_one = charIDToTypeID( "PC_1" );
desc6.putInteger( idPC_one, 25 );
var idPC_two = charIDToTypeID( "PC_2" );
desc6.putInteger( idPC_two, 50 );
var idPC_three = charIDToTypeID( "PC_3" );
desc6.putInteger( idPC_three, 75 );
var idShpR = charIDToTypeID( "ShpR" );
desc6.putDouble( idShpR, 1.000000 );
var idShpD = charIDToTypeID( "ShpD" );
desc6.putInteger( idShpD, 25 );
var idShpM = charIDToTypeID( "ShpM" );
desc6.putInteger( idShpM, 0 );
var idPCVA = charIDToTypeID( "PCVA" );
desc6.putInteger( idPCVA, 0 );
var idGRNA = charIDToTypeID( "GRNA" );
desc6.putInteger( idGRNA, 0 );
var idCNRD = charIDToTypeID( "CNRD" );
desc6.putInteger( idCNRD, 50 );
var idCNRS = charIDToTypeID( "CNRS" );
desc6.putInteger( idCNRS, 50 );
var idLPEn = charIDToTypeID( "LPEn" );
desc6.putInteger( idLPEn, 0 );
var idMDis = charIDToTypeID( "MDis" );
desc6.putInteger( idMDis, 0 );
var idPerV = charIDToTypeID( "PerV" );
desc6.putInteger( idPerV, 0 );
var idPerH = charIDToTypeID( "PerH" );
desc6.putInteger( idPerH, 0 );
var idPerR = charIDToTypeID( "PerR" );
desc6.putDouble( idPerR, 0.000000 );
var idPerS = charIDToTypeID( "PerS" );
desc6.putInteger( idPerS, 100 );
var idPerA = charIDToTypeID( "PerA" );
desc6.putInteger( idPerA, 0 );
var idPerU = charIDToTypeID( "PerU" );
desc6.putInteger( idPerU, 0 );
var idPerX = charIDToTypeID( "PerX" );
desc6.putDouble( idPerX, 0.000000 );
var idPerY = charIDToTypeID( "PerY" );
desc6.putDouble( idPerY, 0.000000 );
var idAuCA = charIDToTypeID( "AuCA" );
desc6.putInteger( idAuCA, 0 );
var idExonetwo = charIDToTypeID( "Ex12" );
desc6.putDouble( idExonetwo, 0.000000 );
var idCronetwo = charIDToTypeID( "Cr12" );
desc6.putInteger( idCronetwo, 0 );
var idHionetwo = charIDToTypeID( "Hi12" );
desc6.putInteger( idHionetwo, 0 );
var idShonetwo = charIDToTypeID( "Sh12" );
desc6.putInteger( idShonetwo, -12 );
var idWhonetwo = charIDToTypeID( "Wh12" );
desc6.putInteger( idWhonetwo, 0 );
var idBkonetwo = charIDToTypeID( "Bk12" );
desc6.putInteger( idBkonetwo, -11 );
var idClonetwo = charIDToTypeID( "Cl12" );
desc6.putInteger( idClonetwo, 8 );
var idDfPA = charIDToTypeID( "DfPA" );
desc6.putInteger( idDfPA, 0 );
var idDPHL = charIDToTypeID( "DPHL" );
desc6.putInteger( idDPHL, 30 );
var idDPHH = charIDToTypeID( "DPHH" );
desc6.putInteger( idDPHH, 70 );
var idDfGA = charIDToTypeID( "DfGA" );
desc6.putInteger( idDfGA, 0 );
var idDPGL = charIDToTypeID( "DPGL" );
desc6.putInteger( idDPGL, 40 );
var idDPGH = charIDToTypeID( "DPGH" );
desc6.putInteger( idDPGH, 60 );
var idDhze = charIDToTypeID( "Dhze" );
desc6.putInteger( idDhze, 0 );
var idTMMs = charIDToTypeID( "TMMs" );
desc6.putInteger( idTMMs, 0 );
var idCrv = charIDToTypeID( "Crv " );
var list1 = new ActionList();
list1.putInteger( 0 );
list1.putInteger( 0 );
list1.putInteger( 255 );
list1.putInteger( 255 );
desc6.putList( idCrv, list1 );
var idCrvR = charIDToTypeID( "CrvR" );
var list2 = new ActionList();
list2.putInteger( 0 );
list2.putInteger( 0 );
list2.putInteger( 255 );
list2.putInteger( 255 );
desc6.putList( idCrvR, list2 );
var idCrvG = charIDToTypeID( "CrvG" );
var list3 = new ActionList();
list3.putInteger( 0 );
list3.putInteger( 0 );
list3.putInteger( 255 );
list3.putInteger( 255 );
desc6.putList( idCrvG, list3 );
var idCrvB = charIDToTypeID( "CrvB" );
var list4 = new ActionList();
list4.putInteger( 0 );
list4.putInteger( 0 );
list4.putInteger( 255 );
list4.putInteger( 255 );
desc6.putList( idCrvB, list4 );
var idCamP = charIDToTypeID( "CamP" );
desc6.putString( idCamP, """Adobe Standard""" );
var idCP_D = charIDToTypeID( "CP_D" );
desc6.putString( idCP_D, """39CE0286CB6EBA9011F3CCAE287F46BD""" );
var idPrVe = charIDToTypeID( "PrVe" );
desc6.putInteger( idPrVe, 184549376 );
var idRtch = charIDToTypeID( "Rtch" );
desc6.putString( idRtch, """""" );
var idREye = charIDToTypeID( "REye" );
desc6.putString( idREye, """""" );
var idLCs = charIDToTypeID( "LCs " );
desc6.putString( idLCs, """""" );
var idUpri = charIDToTypeID( "Upri" );
desc6.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 ">
<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/"
crs:UprightVersion="151388160"
crs:UprightCenterMode="0"
crs:UprightCenterNormX="0.5"
crs:UprightCenterNormY="0.5"
crs:UprightFocalMode="0"
crs:UprightFocalLength35mm="35"
crs:UprightPreview="False"
crs:UprightTransformCount="6"/>
</rdf:RDF>
</x:xmpmeta>
""" );
var idGuUr = charIDToTypeID( "GuUr" );
desc6.putString( idGuUr, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21 ">
<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/"
crs:UprightFourSegmentsCount="0"/>
</rdf:RDF>
</x:xmpmeta>
""" );
var idLook = charIDToTypeID( "Look" );
desc6.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 ">
<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/">
<crs:Look>
<rdf:Description
crs:Name="Adobe Color"
crs:Amount="1.000000"
crs:UUID="B952C231111CD8E0ECCF14B86BAA7077"
crs:SupportsAmount="false"
crs:SupportsMonochrome="false"
crs:SupportsOutputReferred="false"
crs:Copyright="© 2018 Adobe Systems, Inc.">
<crs:Group>
<rdf:Alt>
<rdf:li xml:lang="x-default">Profiles</rdf:li>
</rdf:Alt>
</crs:Group>
<crs:Parameters>
<rdf:Description
crs:Version="11.2"
crs:ProcessVersion="11.0"
crs:ConvertToGrayscale="False"
crs:CameraProfile="Adobe Standard"
crs:LookTable="E1095149FDB39D7A057BAB208837E2E1">
<crs:ToneCurvePV2012>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>22, 16</rdf:li>
<rdf:li>40, 35</rdf:li>
<rdf:li>127, 127</rdf:li>
<rdf:li>224, 230</rdf:li>
<rdf:li>240, 246</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012>
<crs:ToneCurvePV2012Red>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012Red>
<crs:ToneCurvePV2012Green>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012Green>
<crs:ToneCurvePV2012Blue>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012Blue>
</rdf:Description>
</crs:Parameters>
</rdf:Description>
</crs:Look>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
""" );
var idPset = charIDToTypeID( "Pset" );
desc6.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 ">
<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/">
<crs:Preset>
<rdf:Description
crs:Name="1"
crs:Amount="1.000000"
crs:UUID="EF8032DC2200DB48895A492C8187A140"
crs:SupportsAmount="false"
crs:LookAmount="1.000000">
<crs:Group>
<rdf:Alt>
<rdf:li xml:lang="x-default">05-03-19</rdf:li>
</rdf:Alt>
</crs:Group>
<crs:Parameters>
<rdf:Description
crs:Version="11.2"
crs:ProcessVersion="11.0"
crs:WhiteBalance="Custom"
crs:Temperature="5200"
crs:Tint="+2"
crs:Saturation="-18"
crs:Sharpness="40"
crs:LuminanceSmoothing="0"
crs:ColorNoiseReduction="25"
crs:VignetteAmount="0"
crs:ShadowTint="0"
crs:RedHue="0"
crs:RedSaturation="0"
crs:GreenHue="0"
crs:GreenSaturation="0"
crs:BlueHue="0"
crs:BlueSaturation="0"
crs:Vibrance="0"
crs:HueAdjustmentRed="0"
crs:HueAdjustmentOrange="0"
crs:HueAdjustmentYellow="0"
crs:HueAdjustmentGreen="0"
crs:HueAdjustmentAqua="0"
crs:HueAdjustmentBlue="0"
crs:HueAdjustmentPurple="0"
crs:HueAdjustmentMagenta="0"
crs:SaturationAdjustmentRed="0"
crs:SaturationAdjustmentOrange="0"
crs:SaturationAdjustmentYellow="0"
crs:SaturationAdjustmentGreen="0"
crs:SaturationAdjustmentAqua="0"
crs:SaturationAdjustmentBlue="0"
crs:SaturationAdjustmentPurple="0"
crs:SaturationAdjustmentMagenta="0"
crs:LuminanceAdjustmentRed="0"
crs:LuminanceAdjustmentOrange="0"
crs:LuminanceAdjustmentYellow="0"
crs:LuminanceAdjustmentGreen="0"
crs:LuminanceAdjustmentAqua="0"
crs:LuminanceAdjustmentBlue="0"
crs:LuminanceAdjustmentPurple="0"
crs:LuminanceAdjustmentMagenta="0"
crs:SplitToningShadowHue="0"
crs:SplitToningShadowSaturation="0"
crs:SplitToningHighlightHue="0"
crs:SplitToningHighlightSaturation="0"
crs:SplitToningBalance="0"
crs:ParametricShadows="0"
crs:ParametricDarks="0"
crs:ParametricLights="0"
crs:ParametricHighlights="0"
crs:ParametricShadowSplit="25"
crs:ParametricMidtoneSplit="50"
crs:ParametricHighlightSplit="75"
crs:SharpenRadius="+1.0"
crs:SharpenDetail="25"
crs:SharpenEdgeMasking="0"
crs:PostCropVignetteAmount="0"
crs:GrainAmount="0"
crs:ColorNoiseReductionDetail="50"
crs:ColorNoiseReductionSmoothness="50"
crs:LensProfileEnable="0"
crs:LensManualDistortionAmount="0"
crs:PerspectiveVertical="0"
crs:PerspectiveHorizontal="0"
crs:PerspectiveRotate="0.0"
crs:PerspectiveScale="100"
crs:PerspectiveAspect="0"
crs:PerspectiveUpright="0"
crs:PerspectiveX="0.00"
crs:PerspectiveY="0.00"
crs:AutoLateralCA="0"
crs:Exposure2012="0.00"
crs:Contrast2012="0"
crs:Highlights2012="0"
crs:Shadows2012="-12"
crs:Whites2012="0"
crs:Blacks2012="-11"
crs:Clarity2012="+8"
crs:DefringePurpleAmount="0"
crs:DefringePurpleHueLo="30"
crs:DefringePurpleHueHi="70"
crs:DefringeGreenAmount="0"
crs:DefringeGreenHueLo="40"
crs:DefringeGreenHueHi="60"
crs:Dehaze="0"
crs:OverrideLookVignette="False"
crs:ToneCurveName2012="Linear"
crs:LensProfileSetup="LensDefaults">
<crs:ToneCurvePV2012>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012>
<crs:ToneCurvePV2012Red>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012Red>
<crs:ToneCurvePV2012Green>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012Green>
<crs:ToneCurvePV2012Blue>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurvePV2012Blue>
</rdf:Description>
</crs:Parameters>
</rdf:Description>
</crs:Preset>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
""" );
var idCrpT = charIDToTypeID( "CrpT" );
desc6.putDouble( idCrpT, 0.000000 );
var idCrpL = charIDToTypeID( "CrpL" );
desc6.putDouble( idCrpL, 0.000000 );
var idCrpB = charIDToTypeID( "CrpB" );
desc6.putDouble( idCrpB, 0.000000 );
var idCrpR = charIDToTypeID( "CrpR" );
desc6.putDouble( idCrpR, 0.000000 );
var idCrpA = charIDToTypeID( "CrpA" );
desc6.putDouble( idCrpA, 0.000000 );
var idClrS = charIDToTypeID( "ClrS" );
var idClrS = charIDToTypeID( "ClrS" );
var idSMPT = charIDToTypeID( "SMPT" );
desc6.putEnumerated( idClrS, idClrS, idSMPT );
var idBtDp = charIDToTypeID( "BtDp" );
var idBtDp = charIDToTypeID( "BtDp" );
var idBDeight = charIDToTypeID( "BD8 " );
desc6.putEnumerated( idBtDp, idBtDp, idBDeight );
var idRStF = charIDToTypeID( "RStF" );
var idRStF = charIDToTypeID( "RStF" );
var idRFNo = charIDToTypeID( "RFNo" );
desc6.putEnumerated( idRStF, idRStF, idRFNo );
var idRslt = charIDToTypeID( "Rslt" );
desc6.putDouble( idRslt, 300.000000 );
var idReUn = charIDToTypeID( "ReUn" );
var idReUn = charIDToTypeID( "ReUn" );
var idPpIn = charIDToTypeID( "PpIn" );
desc6.putEnumerated( idReUn, idReUn, idPpIn );
var idEnDe = charIDToTypeID( "EnDe" );
desc6.putBoolean( idEnDe, false );
var idOSM = charIDToTypeID( "OSM " );
var idOSM = charIDToTypeID( "OSM " );
var idOSMN = charIDToTypeID( "OSMN" );
desc6.putEnumerated( idOSM, idOSM, idOSMN );
var idOrnt = charIDToTypeID( "Ornt" );
desc6.putInteger( idOrnt, 0 );
var idSnap = charIDToTypeID( "Snap" );
desc6.putString( idSnap, """""" );
var idAdobeCameraRaw = stringIDToTypeID( "Adobe Camera Raw" );
desc5.putObject( idAs, idAdobeCameraRaw, desc6 );
var idsmartObject = stringIDToTypeID( "smartObject" );
desc5.putBoolean( idsmartObject, true );
var idDocI = charIDToTypeID( "DocI" );
desc5.putInteger( idDocI, 506 );
executeAction( idOpn, desc5, DialogModes.NO );
}
Copy link to clipboard
Copied
var file = File.openDialog("Please select RAW file");
OpenCameraRaw( file,false,true );
function OpenCameraRaw(file,ACR,SO) {
var desc = new ActionDescriptor();
desc.putPath(charIDToTypeID('null'), File(file));
desc.putBoolean(stringIDToTypeID('overrideOpen'), true);
if (SO) desc.putBoolean( stringIDToTypeID('smartObject'), true );
try{
if(ACR){ executeAction(charIDToTypeID('Opn '), desc, DialogModes.ALL);
}else{ executeAction(charIDToTypeID('Opn '), desc, DialogModes.NO);
} }catch(e){}
}
Copy link to clipboard
Copied
Much cleaner and did the job.
Exactly what I needed. Thank you!
Copy link to clipboard
Copied
open(file, OpenDocumentType.CAMERARAW, true);
or
open(file, new CameraRAWOpenOptions(), true);
Copy link to clipboard
Copied
SuperMerlin​ your script works but r-bin​'s script is actually what I was hoping for because it even avoids ScriptListener and creating another function.
Thank you both, awesome as always.
Copy link to clipboard
Copied
I have a small question that derived from this,
I used this line
alert(activeDocument.path)
and i got this:
for a function that uses system to move a file in windows i need this format:
any ideas on how to turn activeDocument.path to the format i need?
Copy link to clipboard
Copied
alert(activeDocument.path.fsName)
Copy link to clipboard
Copied
Kukurykus​ perfect.
Copy link to clipboard
Copied
Wanted to ask, is there a way to script an edit content of NEF in Camera Raw to:
1. Transform Tool > Upright = Full
2. Straighten Tool Double Click = Auto-Straighten & Crop
If there's a script or a way to have the same result without using Camera Raw this will be great too.
This could help me a lot!

