Skip to main content
Pedro Cortez Marques
Legend
Jul 4, 2011 10:52 AM UTC
Answered

Bridge looses cache folder tree window when I rename parent folder

I managed to activate the code to change the name of the parent folder containing some images (I put an underscore before de parent folder name).

When I did it by hand, the folder and subfolders I was navigating on were visible on the folder window (left side)

But I lose the navigation of folders in the left window when I do exactly the same by code.

(...)

    var newPath = decodeURI(Path.parent)+"/_"+name;
    var bt = new BridgeTalk();
    bt.target = "bridge";
    // as acções do bridge contêm 1. colocação do _   2. label  3. organização dos ficheiros por tipo
    bt.body = "app.document.thumbnail =Folder('"+newPath+"').fsName;";
    bt.send(8);
    bt.pump();

(...)

... and the left navigation desapears...

Is there same cache loosing problem? Can I recreate the last folder navigational window some how with code?

This topic is closed to new replies. Start a new post to keep the conversation going.
Pedro Cortez Marques
Pedro Cortez MarquesCorrect answer
Legend
Jul 15, 2014 10:54 AM UTC

Im not sure what you mean by this… This should reset the active doc thumbnail back to the renamed folder…

#target bridge app.bringToFront(); var orgName = app.document.thumbnail.spec.name, orgPath = app.document.thumbnail.spec.path, newName = '_' + orgName; app.document.thumbnail.spec.rename( newName ); var newThumb = new Thumbnail( Folder( orgPath + '/' + newName ) ); app.document.thumbnail = newThumb;


I can't believe I found it, but it works and it is simple.

At the same time, I spent 2 years using Bridge the wrong way and if I had an Adobe Bridge dev here, I wouldn't be very happy.

Why Adobe simply can't give straight and direct answers like this case?

When i rename a app.document.presentationPath, I usually returned to its parent folder on first place and then refresh() this one.

Then I would go back to the new renamed folder.

Problem:

The 'Content' panel was OK and refreshed but the 'Folders' panel was not: the last non-renamed folder was still there and I always needed to close its parent folder on 'Folder' panel, click F5, and reopen making that ghost folder to disappear.

The solution is simple and logical but sadly it took 2 years for me to solve it.

I only needed to start dealing with the node string containing a fully qualified Bridge URI (uniform resource identifier).

For example:

var origin = Folder(app.document.presentationPath);

var renamedFolderName = 'v_'+ Folder(app.document.presentationPath).name;

app.document.thumbnail = new Thumbnail(new Folder(app.document.presentationPath).parent); // back to parent folder

//

Folder(origin).rename(renamedFolderName ); // renaming

app.document.thumbnail.refresh(); // refreshing the parent folder

app.document.thumbnail = new Thumbnail(new Thumbnail(Folder(Folder(origin).parent + "/" + renamedFolderName ).fsName).uri); // the uri is the node (fully qualified Bridge URI)

And... the 'Folders' panel was updated correctly and the ghost folder vanished!

7 replies

Inspiring
Jul 6, 2011 9:06 AM UTC

Pedro, I have No Idea why you are using bridgetalk to do this? Any how I don't have any issues when I change the name of the active document window like this…

#target bridge app.bringToFront(); app.document.thumbnail.spec.rename( '_' + app.document.thumbnail.spec.name );

It correctly now moves to the top of the tree of my desktop…

Translate
Pedro Cortez Marques
Legend
Jul 6, 2011 9:52 AM UTC

Yes, the simpler, the best.

Now it keeps the navigating folders open/closed in the left folders column but...

I wanted him not to go to the parent folder above but be able to keep the view - on the central content window - of the files in the folder I've just renamed (not the parent).

Rename but not move (or to return to the view of the folder remaned). 50% resolved, sorry.

Thanks

Translate
Inspiring
Jul 6, 2011 10:56 AM UTC

Im not sure what you mean by this… This should reset the active doc thumbnail back to the renamed folder…

#target bridge app.bringToFront(); var orgName = app.document.thumbnail.spec.name, orgPath = app.document.thumbnail.spec.path, newName = '_' + orgName; app.document.thumbnail.spec.rename( newName ); var newThumb = new Thumbnail( Folder( orgPath + '/' + newName ) ); app.document.thumbnail = newThumb;

Translate