Copy link to clipboard
Copied
Hello, there. Let's see if anybody can help...
I have a Bridge script that renames and move the visibleThumbnails to new folders.
Easy like this: I have 15 visibleThumbnails, then the script will creates 15 folders and move each visibleThumbnail to its own folder.
BUT...
I need another function to run over the new created folders.
This another function is being called after the loop that create the folders.
But this another function never runs unless I put an alert at its beginning.
Any help?
Copy link to clipboard
Copied
@lfcorullon – Perhaps if you shared the code...
Copy link to clipboard
Copied
I don't think it'll help. My scenario is very particular.
I have three functions:
function rotate() {
/*compare the width and height and rotate vertical image counterclockwise*/
}
function move() {
/*it creates a folder and move each thumbnail to one new folder.
if 15 thumbnails, then 15 folders will be created, numbered, to move each thumb to its folder*/
}
function rename() {
/*rename some files that are previously moved to a new folder*/
}
And I think this is the problem. Bridge doesn't wait the folder creation and the files to be moved to start the next function. When it starts, no folders are created yet.
Copy link to clipboard
Copied
I don't think it'll help.
By @lfcorullon
You have a problem with the code, however, you don't think that it will help to post the code in full. Not sure what can be done then.
Copy link to clipboard
Copied
Ok. I'm sorry but I can't share the full code.
I just want to know if there is a way to make Bridge wait the completion of a process before to start a new one...
RUN function 1 and WAIT to the completion.
RUN function 2 and WAIT to the completion.
Then RUN function 3 and FINISH.
Copy link to clipboard
Copied
Ok. I'm sorry but I can't share the full code.
By @lfcorullon
In Photoshop one can use refresh or sleep – however, I don't script Bridge very often so offhand I'm not sure if it's supported:
app.refresh();
$.sleep(100);
These don't wait, they just add a time delay for something to catch up. Good luck, perhaps someone that scripts Bridge more often than I do can offer advice.
Copy link to clipboard
Copied
Thanks anyway.
I tried app.refresh, thumbnail.refresh, doc.refresh... none of them looks to really work.
The $.sleep() is an option, but it could get too long when processing lots of images.