How to pass/get selected text from active OEA editor to "Customization program".

Hi,

In OE Architect you can run your own procedures from menu or context menu using OpenEdge Customization editor. If I select some text from active file on editor, is there any change to get that selected text in called procedure? Meaning that I have some file opened in OEA. Then I select text from it. Then I run my own procedure (ie test.p) that I have added to Customization/Extensibility menu. In that called procedure (test.p) I need to know that selected text.

When using old Progress Procedure editor, this can be done like this (procedure run from Procedure Editor menu):

DEFINE INPUT PARAMETER iEditor AS WIDGET-HANDLE NO-UNDO.

DEFINE VARIABLE pw_Window AS WIDGET-HANDLE NO-UNDO.
DEFINE VARIABLE pw_Editor AS WIDGET-HANDLE NO-UNDO.

DEF VAR xTmp AS CHAR NO-UNDO.

/* Get widget handles of Procedure Window and its editor widget. */
IF iEditor <> ? THEN pw_editor = iEditor.
ELSE DO:
RUN adecomm/_pwgetwh.p ( INPUT SELF , OUTPUT pw_Window ).
RUN adecomm/_pwgeteh.p ( INPUT pw_Window , OUTPUT pw_Editor ).
END.

xTmp = pw_Editor:SELECTION-TEXT.
...

Is there some way to do this in Architect? How can I get handle of active OEA Editor? Or is there some other way to do this?

When defining action details in customization options in OEA there is field parameters under the program name. Can this be used to pass selected text?

I have tried to find solution to this problem for a time, so I would appreciate a lot, if some one could help me.

Best Regards,
Toby


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I use AutoIT

Its not "state of the art", but I use AutoIT and make Architect do a "copy to clipboard" operation.
(Note that AutoIT has a DLL/COM control available, so the following stuff could all be called directly from ABL.)

Example:
$InitialClipboardValue = ClipGet()
AutoItSetOption ("WinTitleMatchMode", 2)
WinActivate ( "OpenEdge Architect")
Send("^c")
$CodeToAlign = ClipGet()
EnvSet("Function","Align")
EnvSet("SelectedTExt",$CodeToAlign)
RunWait ( "C:\Progress102A\OpenEdge\bin\prowin32.exe -p F:/TeamDev/DevTools/ProtoolsLumec.p" , "c:\pro_tmp\")
WinActivate ( "OpenEdge Architect")
Send("^v{HOME}")
ClipPut($InitialClipboardValue)


Enhancement request 3620.

I just entered enhancement request 3620 for this option.
It would save the use of the external library.