Copy link to clipboard
Copied
Hello,
I execute following code in Photoshop.
var bt = new BridgeTalk();
bt.target = "bridge";
var arg = {
folder: arguments[0] == undefined ? Folder("~/") : arguments[0],
bounds: Ini.screen.bounds
}
bt.body = """
(function () {
var arg = """ + arg.toSource() + """
for ( var i in arg.bounds ) arg.bounds[i] = Number(arg.bounds[i]);
var doc = new Document( arg.folder );
with ( doc ){
maximize();
resetToDefaultWorkspace();
try { browserMode = "full"; } catch (e) {}
setWorkspace ("lightTable");
height = arg.bounds.h / 4;
return [id].toSource();
}
})();
""";
bt.send();
The specified directory opens in Bridge with no problem in versions up to Ps2022, but does not work in Ps2023.
Does anyone know the cause and solution?
Thank you in advance!
Yasu
try this:
app.browseTo(arg.folder);
var doc = app.document;
instead of
var doc = new Document( arg.folder );
Copy link to clipboard
Copied
After the update, I also noticed that at some point bridgeTalk stopped working, but after restarting the computer, everything returned to normal.
If you write the arguments as constants, then you can run the script directly in the bridge (without using bridgeTalk) to debug and understand what exactly the problem is in the code execution.
In the new version, the document may contain tabs, most likely, this has affected the structure of DOM objects.
Copy link to clipboard
Copied
Thank you for your reply.
I restarted my computer and it was the same.
When I tried to debug in the bridge, I got an error in the file opening. It seems likely that the new tab feature of the new bridge is affecting this.
Thank you for the hint!
Yasuo
Copy link to clipboard
Copied
try this:
app.browseTo(arg.folder);
var doc = app.document;
instead of
var doc = new Document( arg.folder );
Copy link to clipboard
Copied
I replaced it with the code you gave me and it worked!
Thank you very much!
Copy link to clipboard
Copied
I am actually able to achieve my goal which is to make Bridge to go a folder using the document thumbnail property. However, Bridge never comes up front like I wish it would, here on Win11. Does Bridge stay in the background for you? I tried to bring it with BridgeTalk.bringToFront("bridge"), but to no avail.
Copy link to clipboard
Copied
var bt = new BridgeTalk();
bt.target = "bridge";
bt.body = "(function () {app.bringToFront();})();";
bt.send();
Copy link to clipboard
Copied
Very good, this worked! Thank you.