Skip to main content
Participant
November 30, 2015
Question

Current active window bridge path

  • November 30, 2015
  • 1 reply
  • 754 views

Hi

Im trying to make a context Menu script that creats several folders once i press it.

The problem is, i don't know how to get the current active window path for the creation of the folders. Im currently stuck with an absolute path.

Anyone know how i can modify the red line to make it work with the current folder path that bridge is displaying when i press the menu?

This is what i have:



#target bridge   

   if( BridgeTalk.appName == "bridge" ) {   

var Ordnerstruktur = new MenuElement( "command", "Ordnerstruktur Erstellen", "-at the end of Thumbnail","uniqueId1"); 

Ordnerstruktur.onSelect = function () {  

var folder1 = Folder("~/desktop/My New Folder");

//Check if it exist, if not create it.

if(!folder1.exists) folder1.create();       

       

alert("Menü 1 gedrückt");

   

   

This topic has been closed for replies.

1 reply

SuperMerlin
Inspiring
November 30, 2015

var folder1 = Folder(app.document.presentationPath + "/My New Folder");

Participant
November 30, 2015

That works great!!! Thanks

Do you know how to create a parent folder with subfolders in it? The parent folder should be already selected and ready to be renamed. Just like when you right click and press "new folder".

So what i need is: When i press the context menu a folder with several subfolders gets created and the parent folder is ready to be renamed.

SuperMerlin
Inspiring
November 30, 2015

I don't think that is possible, but you can change to the parent folder and rename your folder.

If you wanted the new name you could promt the user for a name:-

var userFolderName = prompt('Please enter a name for the export folder');