Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Aborting Scripts

New Here ,
Oct 13, 2005 Oct 13, 2005
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?
TOPICS
Scripting
316
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 14, 2005 Oct 14, 2005
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines