Re: INVOKE ACTION only works when I trace through it

2018-11-11 Thread Jeremy French via 4D_Tech
Hi Pat,

Can you simply assign tEditText to the field after returning from the method 
*PicturePathSelect*?

That is:

*PicturePathSelect* (->tEditText) // choose a pic, copy pathname to tEditText

[someTable]someField := tEditText

Regards,
Jeremy French


> On Nov 11, 2018, at 12:39 PM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Using v17, Mac
> 
> I have an enterable field on a form. The user can right-click on it and
> select an action such as "Select a picture" from a dynamic popup menu.
> 
> The code that runs:
> 
> tEditText:=""
> 
> *PicturePathSelect* (->tEditText) // choose a pic, copy pathname to
> tEditText
> 
> *SET TEXT TO PASTEBOARD*(tEditText)
> 
> *INVOKE ACTION*(ak clear)
> 
> *INVOKE ACTION*(ak paste)
> If I put a trace on the last line of this code and then step through that
> line, then press F5, it works as expected: the picture pathname is copied
> into the selected field.
> If I don't trace through it, this simply does not work. The field is no
> longer the active object and the text hasn't been copied into it.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

INVOKE ACTION only works when I trace through it

2018-11-11 Thread Pat Bensky via 4D_Tech
Using v17, Mac

I have an enterable field on a form. The user can right-click on it and
select an action such as "Select a picture" from a dynamic popup menu.

The code that runs:

tEditText:=""

*PicturePathSelect* (->tEditText) // choose a pic, copy pathname to
tEditText

*SET TEXT TO PASTEBOARD*(tEditText)

*INVOKE ACTION*(ak clear)

*INVOKE ACTION*(ak paste)
If I put a trace on the last line of this code and then step through that
line, then press F5, it works as expected: the picture pathname is copied
into the selected field.
If I don't trace through it, this simply does not work. The field is no
longer the active object and the text hasn't been copied into it.

I also tried

*POST KEY*(*Character code*("v");Command key mask;tEditText)
instead of *INVOKE ACTION*(ak paste)
but that doesn't work either.

Is there something else I need to do to get this to work?

Pat

-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**