Please help :)

In Photoshop CC under "File > Place Linked..." I can select a file to be placed as a linked layer (layer with a link icon over the layer thumbnail). I would like a Photoshop script to do this same process with a predetermined file path. To clarify, I do **not** want an embedded smart object. It must be linked to the file so if there are changes to the original linked file I can go to Menu: "Layer > Smart Objects > Update All Modified Content" and it will update the linked layer with the any new changes. The layer should look like this:

[![enter image description here][1]][1]

I was able to add a layer, convert it to a smart object, and replace it with a provided file. Only thing left is to have it be a linked layer rather than an embedded smart object. 

If more info/screen shots are required please reach out, Any help is greatly appreciated!

```

var convertToSmartObject = function () {
    var idnewPlacedLayer = stringIDToTypeID('newPlacedLayer');
    executeAction(idnewPlacedLayer, undefined, DialogModes.NO);
};
var replaceSmartObjectContents = function (filePath, smartObj) {
    app.activeDocument.activeLayer = smartObj;
    var idplacedLayerReplaceContents = stringIDToTypeID("placedLayerReplaceContents");
    var desc3 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    desc3.putPath(idnull, new File(filePath));
    var idPgNm = charIDToTypeID("PgNm");
    desc3.putInteger(idPgNm, 1);
    executeAction(idplacedLayerReplaceContents, desc3, DialogModes.NO);
};
var doc = app.activeDocument;

// Add a layer, this will now be the active layer
doc.artLayers.add();  

// Convert active layer to Smart Object
convertToSmartObject(); 

// replace a provided layer with a provided file path
replaceSmartObjectContents("~/Path/To/File.ai", doc.activeLayer);

```


  [1]: https://i.sstatic.net/qLU7G.png