Skip to main content
Known Participant
December 20, 2005
Question

How to cancel a BridgeTalkLongProcess

  • December 20, 2005
  • 4 replies
  • 566 views
I have successfully implimented a BridgeTalkLongProcess from the AdobeLibrary1. In my application the user can select the thumbnails in bridge and then run an extensive processing routine in photoshop, with the status palette showing the progress. This can take a long time, and the user may decide to stop the process.

I have over-ridden the BridgeTalkLongProcess.prototype.send function to change the progress palette cancel button text from 'OK' to 'Cancel'. If I click on the palette progress cancel button while the script is running the progress palette does close, but the script continues to process the file queue in photoshop.

What I do not know how to do is send a message from bridge to photoshop to cancel the photshop script if the user clicks on the progress palette cancel button.

I think I will have to over-ride the progressDialog function and create another bridgetalk message to send a cancel order back to photoshop, where I can set a global cancel flag. In my photoshop remote script I can then regularily check the cancel flag status.

Am I on the right track?

Thanks
Rory
This topic has been closed for replies.

4 replies

hillrgAuthor
Known Participant
December 20, 2005
BTIterator works fine. My problem was with a status palette I implemented, which I was updating with BT messages. I can see now that I was not checking BridgeTalk.isRunning before sending update status messages. I think this was causing the problem.

Rory
Known Participant
December 20, 2005
Interesting...

I've run the BTIterator class against over 500 files before with no stability problems. The process was converting a pile of jpegs to pngs in Photoshop.

What kind of symptoms are you seeing?

Bob
hillrgAuthor
Known Participant
December 20, 2005
Thanks Bob. I understand now. Thanks for the speedy response!

That is what I liked about your file iterator approach. I was able to terminate because a separate BT message was being fired for each file. However, I was having stability problems in the progress palette when using fileIterator (bridge would hang after 4-8 files), so I switched to the long process, which is stable.

Regards
Rory
Known Participant
December 20, 2005
Rory,

The track you're on is logical, but won't work. The bottom line is that once you've started something that takes a long time on the target, you're there for the duration. Only thing you can do is hit "escape" in PS or force quit.

Here's the reason (and it's a limitation of BridgeTalk in this version):

When you send a BT message to Photoshop, Photoshop will queue all subsequent BT messages until the currently running script is complete.

So your cancel message will get through only once the long process has completed (and then there's no point). I know of no way to work around this because while any BT launched script is executing no messages will be received until the script is done.

But thanks, you have reminded me to make sure this isn't the case in the next version of BridgeTalk.

Sorry

Bob
Adobe Workflow Scripting