-
1. Re: Bug in event manager ?
habaki1 May 23, 2010 7:07 AM (in response to habaki1)Hello again !
In fact Photoshop detects and rejects the case of a totally empty script file (0 byte).
So the test must be made with a JSX file containing at least a space char !
Thank you again for answers about this problem.
-
2. Re: Bug in event manager ?
Michael L Hale May 23, 2010 9:41 AM (in response to habaki1)I did a quick test for you using CS4 Extended 32bit on WinXP and an Epson printer. The event script I used was a simple alert noting the event being handled. When I print either to Adobe PDF( Acrobat driver ) or my Epson Photoshop ends up in a similar state. Most but nor all of the menu items are disabled including exit. So I am seeing the same problem.
-
3. Re: Bug in event manager ?
Michael L Hale May 23, 2010 10:20 AM (in response to Michael L Hale)I also just did a quick test in CS5 using the same event scirpt and it works as exppected so it looks like the bug/problem is fixed in that version.
-
4. Re: Bug in event manager ?
habaki1 May 24, 2010 7:07 AM (in response to Michael L Hale)Thank you Micheal for all your tests !
The good news is CS5 seems to fix the problem.
The very bad news is that it is in fact impossible to execute correctly a script on all events in CS4 and probably in all previous versions!
-
5. Re: Bug in event manager ?
c.pfaffenbichler May 25, 2010 1:01 AM (in response to habaki1)Out of curiosity: what kind of Script do you run on all events?
-
6. Re: Bug in event manager ?
habaki1 May 25, 2010 10:50 AM (in response to c.pfaffenbichler)Hello c.pfaffenbichler !
My script only needs to catch some events: open, close, select, set, etc...(not all), but it is simplier to install it once for all events.
Because :
- It can be installed by hand (To install it for each event an installer is needed with a 2nd script).
- To catch an additional event, only the script must be modified, not the install process.
For this development, i also wrote an "eventviewer" (that prints an event with all arguments into an alert box) to see exactly what is the pattern to match for each action i needed to catch. This script must be installed for all events.
The purpose of the main script is to assign a private context to a document and to each layer of a document: for instance a brush with its diameter, FG and BG colors, etc...
-
7. Re: Bug in event manager ?
c.pfaffenbichler May 25, 2010 11:19 PM (in response to habaki1)Ah; thanks for the explanation.
-
8. Re: Bug in event manager ?
Michael L Hale May 27, 2010 5:47 AM (in response to habaki1)You can have the script itself handle the events. And because each event handler slows Photoshop a little I would just register the events needed. Just put the code to register the events near the top of you script and wrap each notifiers.add in a try/catch.
if(!app.notifiersEnabled) app.notifiersEnabled = true;// enable notifiers if needed try{// wrap each notifier in a try/catch statement to avoid error if already registered app.notifiers.add("placedLayerEditContents", new File("C:\\editPlacedEvent.jsx")); }catch(e){} try{// wrap each notifier in a try/catch statement to avoid error if already registered app.notifiers.add("slct", new File("C:\\selectLayerEvent.jsx"), "Lyr " ); }catch(e){} -
9. Re: Bug in event manager ?
habaki1 May 27, 2010 7:20 AM (in response to Michael L Hale)Thank you Michael !
It's a good idea but there is a fowl-egg problem ! The script must be started to be installed and installed to be started.
I was kidding ! It is easy to detect an execution by hand (arguments.length==0) and to call app.notifiers.add only in this case.
Nevertheless an uninstaller is also needed to remove the notifiers added for this script. So i wrote a 2nd script with a user interface to install/uninstall the first. It's better because the drop down list of the event manager is also bugged. Removing only some notifiers often does not work properly.
Thanks again.



