Copy link to clipboard
Copied
Dear friends,
We all know about special effects in the movies, but I can tell you: also ExtendScript can entertain us with such. It appears to be a conjurer of the good old style. It all happens on the stage of FM version 13.0.5.547.
Information for the uninitiated:
When opening one of the panels via menu it happens that in the top left corner a small selection list appears with contents from a previous call:
I can create this illusion at will with the following sequence of magic tricks. No, it's not an illusion: Putting the cursor into the selection list the display can be changed with the arrow keys, so it's some sort of real...
From time to time (magic does not happen by schedule) the following effect can be seen:
Unfortunately I can not reproduce this at will... Hence I do not know whether an open ESTK (with nothing in there) has any influence.
I discovered this after a small update of my script and hence guessed the reason for it there - but my update was in a mathematical function, not in the area of the user interface:
Big entertainment, isn't it? But frustrating when trying to get a good script...
What can we learn from these tricks?
Copy link to clipboard
Copied
Hi Klaus,
there's one point that astonishes me:
I unregister the script each time before I start it again (either in ESTK or via script catalogue).
Don't you unregister the notification when the script is closed? (by User or script)
Notification(Constants.FA_Note_PostMouseCommand,false);
If you don't do that, the event could be driggered a second time, when the user starts this script again. (I don't know the possible results).
The other reason for some strange behaviour could be using a variable with the same name in different scripts. So they can interfere.
Example for your "TWINS":
w = new Window("palette","TEST",undefined);
panel = w.add("tabbedpanel",undefined);
tab1 = panel.add("tab",undefined,"Tab1")
When execute this script a second time, under some circumstances it can lead to your "twin-effect".
Just check your scripts with that view.
Copy link to clipboard
Copied
Thank you, Klaus for your thoughts about these effects.
Don't you unregister the notification when the script is closed? (by User or script)
When is a script closed?
I had this unregistering coupled with the Cancel/Exit buttons in the panels - but was not certain whether this hinders a second open of them via menu.
After start of the script (and establishing the menu) It should be possible to
Hence i decided to postpone this automatic unregistering until later.
But your interjection lets me try it again now.
The other reason for some strange behaviour could be using a variable with the same name in different scripts. So they can interfere.
I will check again whether all local variables are really locally defined. Especailly in some longer functions (and the dialogue definitions are long (PaletteDocSettings: 350 lines, PaletteCalcMarkers: 200 lines) there could be some left unddefined (and hence treated global).
Copy link to clipboard
Copied
Dear friends,
For at least one of the mysteries I have broken the spell: The slave
For debugging purpose I had Console statements in the Notify function. When I later opened a panel via menu or keyboard short cut the console window came to the foreground and above it the panel appeared. Since not interested of the messages in the log at that time I dismissed (closed) the log window. At the same time the panel disappeared. And in addition the script was not registered any more...
Having replaced the Console statement by an alert the mystery disappeared.
Klaus