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

Script to rename parent folder and refresh (F5) parent and parent/parent folders

Enthusiast ,
Jan 20, 2011 Jan 20, 2011

Copy link to clipboard

Copied

Now I can already right-hand clic an image inside a folder at bridge and open a pop-up window to put any script.

But now I need to rename the mother folder of the image and refresh (F5) the folder where my image is and his parent folder also.

When we work the images of a folder, we put an "_" in the begining of the images parent folder.

I  also need to be sure to tell the folder to rename but put an IF: if the  folder already biguns with "_" an warn tell that someone is already  working there and it will not rename.

The fact is that we are 5 people opening folders of images and we need to know if someone is already working that folder and warn the others that we are working on a folder.

In fact, I wanted to use color labels to do this, but renaming usures me that if someone opens the directory out side of bridge (windows or mac system), will know if is worked or not.

TOPICS
Scripting

Views

1.2K

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
Valorous Hero ,
Jan 20, 2011 Jan 20, 2011

Copy link to clipboard

Copied

Something like this?


#target bridge  
   if( BridgeTalk.appName == "bridge" ) { 
folderInUse = MenuElement.create("command", "Use Selected Folder", "at the end of Thumbnail");
}
folderInUse.onSelect = function () {
   canUseFolder();
   }
function canUseFolder(){
var CurrentFolder = decodeURI(Folder(app.document.presentationPath).name);
var ParentFolder = Folder(app.document.presentationPath).parent;
var inUseFolderName = "_"+CurrentFolder;
if(CurrentFolder[0]=='_'){
   alert("This folder is in use!\n Please try later");
   return;
    }else{
      Folder(app.document.presentationPath).rename(inUseFolderName);
      app.document.thumbnail = Folder(ParentFolder+"/"+ inUseFolderName);
        }
}

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
Valorous Hero ,
Jan 20, 2011 Jan 20, 2011

Copy link to clipboard

Copied

Sorry forgot you wanted a coloured folder, this will now change the folder colour to Red...


#target bridge
   if( BridgeTalk.appName == "bridge" ) { 
folderInUse = MenuElement.create("command", "Use Selected Folder", "at the end of Thumbnail");
}
folderInUse.onSelect = function () {
   canUseFolder();
   }
function canUseFolder(){
var CurrentFolder = decodeURI(Folder(app.document.presentationPath).name);
var ParentFolder = Folder(app.document.presentationPath).parent;
var inUseFolderName = "_"+CurrentFolder;
if(CurrentFolder[0]=='_'){
   alert("This folder is in use!\n Please try later");
   return;
    }else{
      Folder(app.document.presentationPath).rename(inUseFolderName);
      var Thumb = new Thumbnail(Folder(ParentFolder+"/"+ inUseFolderName));  
        Thumb.label="Select";
        app.document.thumbnail = Folder(ParentFolder+"/"+ inUseFolderName);
        }
}

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
Enthusiast ,
Feb 11, 2011 Feb 11, 2011

Copy link to clipboard

Copied

Hi Paul,

I have tested this with ExtendScript Toolkit CS5, press F5 to test it with bridge and it worked.

But, when I put the script inside the bridge startup scripts folder, and restart it, It doesn't work any more.

...

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
Valorous Hero ,
Feb 11, 2011 Feb 11, 2011

Copy link to clipboard

Copied

It works fine on my setup in the start-up folder, you might check the preferences and make sure that it is enabled.

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
Enthusiast ,
Jul 08, 2011 Jul 08, 2011

Copy link to clipboard

Copied

LATEST

Yes I'm sure its enabled on preferences. This is a big issue to me, because I can't do anything with bridge scripting for 5 months and adobe does not say nothing about. Some other windows7 users complained that after using Bridge for a while, they stop beeing able to make bridge respond to scrips.

I'm so frustated.

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