Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 888

Get focus back into document

$
0
0

Dear friends,

After opening a panel (wPalC) from the menu the focus is (of course) on the panel.
a) Before working in this panel, the user may want to open another panel wPalS (by means of a keyboard shortcut).

The focus should be back in the document for this.
b) If the user choses to work in the already open panel - no problem: Either he uses the immediate focus or as soon as he does anything there the focus is there. For example tool tips are displayed on hover, no click required.
But I have not found a method to get the focus into the document for case a).
I have this function which works fine in other circumstances:

function SetFocusToDoc (oDoc) {
var tRange = oDoc.TextSelection;  oDoc.ScrollToText (tRange);
} //--- end SetFocusToDoc

 

But whether I place the call to this routine at places 1), 2) or 3) - no success. The shortcut will not be executed (no "ping" though):

 

function Command (cmd) {  switch (cmd) {
//  ...     case 5:      HandleCalcMarkers();              // opens panel wPalC      wPalC.active = false;      SetFocusToDoc (goCurrentDoc);     // 1)      break;    case 6:      HandleSeriesMarkers();            // opens panel wPalS                                SetFocusToDoc (goCurrentDoc);     // 2)      break;    case 7:      HandleDocSettings();                                break;  }      SetFocusToDoc (goCurrentDoc);     // 3)
} //--- end Command
  1. I can get the focus in the document with the following method - not for the end-user:
  2. Run the script from ESTK with the menu setup replaced by an in-line selection list
  3. Invoke HandleCalcMarkers from this selection list. The panel is displayed and active
  4. From ESTK directly run (separate instance) SetFocusToDoc (app.ActiveDoc)
  5. In FrameMaker I see the focus in the document (blinking cursor).

How to get the focus back to the document in the script?

Any ideas welcome!

 

Even FM does not provide the focus in the document in all 'desired' cases, for example after Change Zoom level.


Viewing all articles
Browse latest Browse all 888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>