Skip navigation
engco
Currently Being Moderated

[CS4] ScriptUI palette - focus problem

Dec 7, 2008 5:58 AM

Does anyone know of any changes to ScriptUI's focus behaviour?

My palettes (Windows XP) now seem to grab various keystrokes (such as backspace, cursor) regardless of where the cursor is placed. This happens not just to my own scripts but also, eg, Dave Saunder's WrapNudger script or the SnpCreateDialog sample snippet. Needless to say, all scripts behave impeccably under CS3. It makes no difference if the script is placed in a previous version folder or not.

Does anyone have a clue what might be going on?

David
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 6:18 AM
    David,

    I'm not seeing that behavior on my G5 running OS X 10.4.11. Which computer are you using and which operating system?

    Dave
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 7:36 AM
    The difference I see is that the palette gets deactivated in CS3 if you click outside it, whereas in CS4 it's still activated. A quick Alt-Tab away and back to CS4 leaves it in a de-activated state, and then everything works fine. Until you select the palette again.

    (It's spooky what key presses ID figgers should "go into the active palette": cursor and backspace, yes, regular keys and return, no. I heard on the product fora about dialogs that 'ate' some keypresses and put others right into your document.)

    Tried with the very same WrapNudger file, copied into CS3 and CS4. Smells like a bug, all the way from here.

    [Edit: you don't have to Alt-Tab away. You cannot deselect it by clicking in the document, but it does work with mouse clicks on (some of the) panels and the menu bar.]
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 7:53 AM
    And the fact that it works properly on Macs strengthens the feeling that this is a bug in the Windows version of InDesign CS4. Could one of you Windows guys report it here, please:

    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

    Thanks,

    Dave

    PS: Sorry for not noticing your "Windows XP" in parens, David.
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 12:38 PM
    Fellow Scripters,

    For whatever it's worth, this seems like a ScriptUI problem, not an InDesign problem per se. Does anyone have a non-modal ScriptUI panel in Photoshop or Illustrator? If you do, could you verify the problem?

    Thanks,

    Ole
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 2:31 PM
    >And the fact that it works properly on Macs strengthens the feeling that this is a bug in the Windows version of InDesign CS4.

    Which is not to say we don't have weird issues happening with kbd focus on the Mac side!

    Select some text in a text frame.

    AS: Run this Applescript from Script Editor:

    tell application "Adobe InDesign CS4"
    display dialog "Hello world!"
    end tell

    Now try and dismiss the dialog with the Return or Enter key. Say... where'd that selected text underneath the dialog go?!

    I reported this a while back. Hopefully being fixed in 4.01...
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 2:43 PM
    Hi Eric@MCA,

    True, but at least there's an easy workaround in this case (use the dialog object rather than display dialog).

    There's another Mac OS thing with Suitcase--something were you can't enter text in InDesign fields when font auto-activation is turned on, or something like that. I wonder if they're related?

    Thanks,

    Ole
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 3:35 PM
    On 9/12/08 8:43 AM, "Olav Kvern" <member@adobeforums.com> wrote:<br /><br />> but at least there's an easy workaround in this case (use the dialog object<br />> rather than display dialog)<br /><br />Not if you need a third button, though.<br /><br />The other workaround is to have no default button, which means no button<br />named *exactly* "OK". So:<br /><br />tell application "Adobe InDesign CS4"<br />display dialog "Hello world!" buttons {" Cancel ", " OK "}<br />end tell <br /><br />Note the spaces around the Cancel too -- if you don't use them, you get a<br />new answer to the recent question about how to change tools to the selection<br />tool :-)<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 3:35 PM
    Hi Olav,

    Thanks for the response!

    Yeah, they asked that question, but I don't think so. We don't have Suitcase installed on the machines I'm installing CS4 on for testing. And it happens on a fresh, default install of CS4. I have no trust at all for font autoactivation either, so those extensions never get installed.

    Also, it doesn't happen on the earlier beta of CS4 that the Biscotti devs were distributing, so my theory is that it got introduced later in the dev cycle somehow.

    As for using the dialog model, that is true but a huge pain compared to the ease of the display dialog. (Unless I am woefully ignorant of a way to generate a simple OK/Cancel dialog via dialog model.)

    I usually only break that out if I actually need to build a custom dialog with more than a Continue or Cancel? question. And also, the scripts work correctly when run from within the InDesign scripts panel at least. It is only in thetrip from Script Editor to InDesign that display dialog breaks.
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 8, 2008 4:18 PM
    On 9/12/08 9:35 AM, "Eric @ MCA" <member@adobeforums.com> wrote:<br /><br />> And also, the scripts work correctly when run from within the InDesign scripts<br />> panel at least.<br /><br />In which case you can always resort to:<br /><br />tell application "Adobe InDesign CS4"<br />    do script "display dialog \"Hello world!\""<br />end tell<br /><br />Slower, and mucks with the cursor, though...<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Dec 11, 2008 12:27 PM
    Yah, that's definitely not a conversion I want to have to do to my 100 or so ID scripts...

    At any rate, the point for Adobe to take away from this is that no, this has *nothing* to do with Suitcase plugins and needs to be fixed in 4.01 please?
    |
    Mark as:
  • Currently Being Moderated
    Community Member
    May 4, 2009 2:18 PM

    Sadly 6.0.2 still does nothing for this issue.

    Steven

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Jun 26, 2009 9:45 AM

    Unfortunately this issue doesn't seem to be going away any time soon. To clarify in reference to Olev's question, this is an InDesign only issue. After Effect supports modeless dialogs and doesn't have the issue. I tested Photoshop using bridgetalk while writing text on image and didn't have this bug. Using bridgetalk and InDesign gave me the same issue. This hasn't been fixed in 6.03 and as long as its not defined as InDesign only issue will not be fixed.

    Steven

    |
    Mark as:
  • Currently Being Moderated
    Feb 1, 2010 7:18 AM

    Hello!

     

    I've got the same problem with this little palette:

     

     

    #targetengine "session"
    //same problem with own target engine
     
    var pal = new Window("palette", "focustest", undefined, {resizeable:true, closeButton:true});
     
    pal.st = pal.add("statictext", undefined, "bla:");
     
    pal.show();
    

     

     

    As in the original post already said: the palette eats some keystrokes (e.g. I can type "y" but not "a"), the focus remains on the palette.

     

    Is it possible to work with an eventhandler, someting like "onMouseOut focus the layout"?

     

    I'm running InD 6.04 on WinXP... is there a solution for this problem or has somebody a workaround?

     

     

    Best regards,

     

    TYPO

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Feb 17, 2010 10:13 AM

    ok... here's the workaround:

     

    #targetengine "session"
     
    var pal = new Window("palette", "focustest", undefined, {resizeable:true, closeButton:true});
     
    pal.st = pal.add("statictext", undefined, "some static text...");
     
    FocusInDesign = pal.addEventListener("mouseout", LeaveTestPalette);
    function LeaveTestPalette() {
        indesign.reveal();
        }
     
    pal.show();
    

     

     

     

    --> the eventhandler brings InDesign to the front when you leave the palette.

     

    Well, it's still not good: the palette loses the focus too early (as soon as you leave the static text field).

     

    Do I have to work with coordinates of the palette in order to determine if the mouse pointer has really left the palette?

     

    Can somebody please help on?

     

     

    Thanx,

     

    TYPO

    |
    Mark as:
  • Currently Being Moderated
    Feb 10, 2011 6:08 PM

    Is there any solution for this? I am having the same issue, and the workaround i am using is to send focus to indesign as soon as cursors leave the pallete boundaries. If there is a fix for this issue, can someone share a link to that.

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Feb 11, 2011 1:24 AM

    Hello muxamil,

     

    I haven't found any solution. And if you use my workaround in a startup script, this will mess up other things randomly.

    Ain't no fun... so I gave up (for the moment).

     

     

    Cheers,

     

    TYPO

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Feb 11, 2011 1:49 AM

    Dr. TYPO wrote:

     

     

    #targetengine "session"

    var pal = new Window("palette", "focustest", undefined, {resizeable:true, closeButton:true});

    pal.st = pal.add("statictext", undefined, "some static text...");

    FocusInDesign = pal.addEventListener("mouseout", LeaveTestPalette);
    function LeaveTestPalette() {
        indesign.reveal();
        }

    pal.show();

     

     

     

    --> the eventhandler brings InDesign to the front when you leave the palette.

     

    Well, it's still not good: the palette loses the focus too early (as soon as you leave the static text field).

     

    Do I have to work with coordinates of the palette in order to determine if the mouse pointer has really left the palette?

     

    • The problem with working with mouse coordinates is that the palette title bar seems to be out of the scope of ScriptUI. I mean that no mouse event is listenable within this specific area. The mouseout event is notified to the palette (at-target) as soon as the mouse leave the drawable area, excluding the title bar.

     

    • However you can significantly improve your event handler by ignoring any event target which is not the palette itself —don't forget that the mouseout event bubbles (http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseout). Thus you bring ID to the front only when you actually leave the palette drawable area:

     

    #targetengine "mySession"
     
    var pal = new Window("palette", "focustest", undefined, {resizeable:true, closeButton:true});
     
    pal.st = pal.add("statictext", undefined, "some static text...");
     
    pal.addEventListener('mouseout', leaveTestPalette);
     
    function leaveTestPalette(/*MouseEvent*/mev)
         {
         if( mev.target instanceof Window ) app.activate();
         }
     
    pal.show();
    

     

    Does that help?

     

    @+

    Marc

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Feb 11, 2011 1:52 AM

    oh, I forgot to mention "Extendables", which can be found under extendables.org, discussions can be found on this forum.

    To me it looks quite promising...

     

    I've tested the example "ui.jsx" in the examples folder of the extendables download.

    There I've created a ui palette via "new ui.Palette()", unfortunately with the other misbehaviours.

    Although it creates a palette with correct focus, you're not able to type characters other than "qyswxrtup" into a text box.

     

    But maybe this hint will help? If you find a solution, let me know, ok?

     

     

    Cheers,

     

    TYPO

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Feb 11, 2011 1:55 AM

    Hello Marc,

     

    that was quick :-)

     

    thanx & I'll try!

     

    ***

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Feb 11, 2011 2:05 AM

    Hello Marc,

     

    this helps :-)

     

    thanks a million!

     

    //TYPO

    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)