Skip to main content
Participant
November 30, 2023
Question

script relink bypass raw converter

  • November 30, 2023
  • 1 reply
  • 412 views
I have tried to make a script that relinks to the raw file.
It actually works very well, but it opens the raw converter every time.
Since the whole thing must be run as a batch, I would like to avoid having to press enter key 100 times.
Someone who can help with a way to script through the raw converter without adjusting already adjustments.
This topic has been closed for replies.

1 reply

Participant
November 30, 2023

This is the code im running:

var activeDoc = app.activeDocument;
var filepath = new File(activeDoc.fullName);
var bottomLayer = activeDoc.layers[0];
createSmartObject();
function createSmartObject() {
    var idnewPlacedLayer = stringIDToTypeID( 'newPlacedLayer' );
    executeAction(idnewPlacedLayer, undefined, DialogModes.NO);
}
function relinkSO(path) {
    var desc = new ActionDescriptor();
    desc.putPath(charIDToTypeID('null'), new File(path));
    executeAction(stringIDToTypeID('placedLayerRelinkToFile'), desc, DialogModes.NO);
} // end of relinkSO()

// Relink active layer(smart object) with a provided file path
relinkSO(filepath);