• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CEP Panel to reveal file in folder

Explorer ,
Jul 01, 2020 Jul 01, 2020

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]);

TOPICS
How to , SDK

Views

653

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jul 02, 2020 Jul 02, 2020

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) {
});

Votes

Translate

Translate
Adobe Employee ,
Jul 02, 2020 Jul 02, 2020

Copy link to clipboard

Copied

A folder in the OS, or a folder (bin) in the Project panel?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 02, 2020 Jul 02, 2020

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 02, 2020 Jul 02, 2020

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 02, 2020 Jul 02, 2020

Copy link to clipboard

Copied

It opens to "This PC > Documents" -- I tried with both \\ and \ as separator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 02, 2020 Jul 02, 2020

Copy link to clipboard

Copied

LATEST

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) {
});

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines