0
Aborting Scripts
New Here
,
/t5/bridge-discussions/aborting-scripts/td-p/1155640
Oct 13, 2005
Oct 13, 2005
Copy link to clipboard
Copied
I have a Bridge script that loops through a series of files calling a PS script method that does some processing.
Can I abort the PS processing via ESC? Apparently not. It would be nice if an unconsumed ESC at least signalled an error on the next Javascript statement. (Even better would be consistency in PS native methods aborting with ESC.)
If I catch an error in the PS script, how do I reflect the error to Bridge?
I'm guessing that the Bridgetalk sends I'm using are queued such that PS and Bridge are uncoupled. If I get a PS error how do I flush the queued Bridgetalk messages?
Can I abort the PS processing via ESC? Apparently not. It would be nice if an unconsumed ESC at least signalled an error on the next Javascript statement. (Even better would be consistency in PS native methods aborting with ESC.)
If I catch an error in the PS script, how do I reflect the error to Bridge?
I'm guessing that the Bridgetalk sends I'm using are queued such that PS and Bridge are uncoupled. If I get a PS error how do I flush the queued Bridgetalk messages?
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Beginner
,
LATEST
/t5/bridge-discussions/aborting-scripts/m-p/1155641#M24137
Oct 14, 2005
Oct 14, 2005
Copy link to clipboard
Copied
Jack,
I wrote a utility object called BridgeTalkIterator that is contained in AdobeLibrary1.jsx.
It stores an internal queue of BT messages and fires them off one at a time (when the previous BT message returns). It shows a progress bar in Bridge (automatically, you don't have to do anything), and that progress bar has a cancel button.
If you didn't purchase the suite, you can get the libraries by downloading the import from camera script from Adobe Exchange. You should install all three libraries. #1 contains various utilities, #2 contains an XML persistant storage utility (ScriptStore), and #3 contains patches to 1 and 2 plus a couple more utilities.
Also, I posted an example script that shows the usage of it. It's on Exchange as well, called OpenAndClose.
You are correct that messages are queued and that bridge and ps are not uncoupled.
You can't have something like the escape key triggering an error because there's no way to tell what's actually executing at the time the key makes its way through the event chain.
For example, you could have a number of event handlers triggering on document events. You hit escape to stop a script you have in the foreground, but the error could be manifested in one of the document event handlers.
Not to worry, though, BridgeTalkIterator solves your problem.
Bob
Adobe WAS Scripting
I wrote a utility object called BridgeTalkIterator that is contained in AdobeLibrary1.jsx.
It stores an internal queue of BT messages and fires them off one at a time (when the previous BT message returns). It shows a progress bar in Bridge (automatically, you don't have to do anything), and that progress bar has a cancel button.
If you didn't purchase the suite, you can get the libraries by downloading the import from camera script from Adobe Exchange. You should install all three libraries. #1 contains various utilities, #2 contains an XML persistant storage utility (ScriptStore), and #3 contains patches to 1 and 2 plus a couple more utilities.
Also, I posted an example script that shows the usage of it. It's on Exchange as well, called OpenAndClose.
You are correct that messages are queued and that bridge and ps are not uncoupled.
You can't have something like the escape key triggering an error because there's no way to tell what's actually executing at the time the key makes its way through the event chain.
For example, you could have a number of event handlers triggering on document events. You hit escape to stop a script you have in the foreground, but the error could be manifested in one of the document event handlers.
Not to worry, though, BridgeTalkIterator solves your problem.
Bob
Adobe WAS Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

