Copy link to clipboard
Copied
Is there a way to show an Item in a folder in a CEP Panel for Premiere Pro?
In electron I can:
const {shell} = require('electron');
shell.showItemInFolder(fileList[0]);
In adobe I think I should be able to do it through nw.js but I'm not sure how I execute the nw command:
nw.Shell.showItemInFolder(fileList[0]);
After some struggle, I've gotten this to work:
In this case fileList = ["X:\\Preview\\vid\\vid_original\\PRIVATE\\M4ROOT\\CLIP\\C0005.MP4"]
var path = fileList[0]; // This has the file path with escaped backslashes
path = path.replace(/\\\\/g, "\\");
console.log("Path", path);
var command = 'C:\\Windows\\explorer.exe';
var cmd = command + ' /select, "'+path+'"';
var process = require('child_process');
var exec = process.exec;
exec(cmd, function(err, stdout, stderr) {
});
Copy link to clipboard
Copied
A folder in the OS, or a folder (bin) in the Project panel?
Copy link to clipboard
Copied
It is a folder in the OS...
I've come across your previous answers suggesting : window.cep.process.createProcess('C:\\Windows\\explorer.exe','yourAbsoluteFolderPathAsString')
However, this runs Windows explorer, but doesn't open to the correct folder.
Ideally, I'd like to use the "/select," option so that a particular file is highlighted, and of course use the file path in that case.
I have also seen that someone else is running into a similar issue here, but I don't see a good response to it - https://stackoverflow.com/questions/38448873/opening-explorer-to-a-specific-file-in-node-js
Thanks!
Copy link to clipboard
Copied
>...However, this runs Windows explorer, but doesn't open to the correct folder.
Here, it opens the folder specified by the string; what does it open, on your system?
> Ideally, I'd like to use the "/select," option so that a particular file is highlighted, and of course use the file path in that case.
I don't know of any way to accomplish that, using CEP calls.
Copy link to clipboard
Copied
It opens to "This PC > Documents" -- I tried with both \\ and \ as separator
Copy link to clipboard
Copied
After some struggle, I've gotten this to work:
In this case fileList = ["X:\\Preview\\vid\\vid_original\\PRIVATE\\M4ROOT\\CLIP\\C0005.MP4"]
var path = fileList[0]; // This has the file path with escaped backslashes
path = path.replace(/\\\\/g, "\\");
console.log("Path", path);
var command = 'C:\\Windows\\explorer.exe';
var cmd = command + ' /select, "'+path+'"';
var process = require('child_process');
var exec = process.exec;
exec(cmd, function(err, stdout, stderr) {
});