Send 4D_Tech mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.4d.com/mailman/listinfo/4d_tech
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of 4D_Tech digest..."
Today's Topics:
1. Re: OAuth (Jeremy Roussak)
2. Lep Redirect (Peter Mew)
3. Re: Help LEP macOS to open the Emoji viewer (Keisuke Miyako)
4. Re: Re: OAuth (Bruno LEGAY)
5. Re: Help LEP macOS to open the Emoji viewer (ADeeg)
6. Re: Lep Redirect (Keisuke Miyako)
7. Looping and control flow (Sandor Szatmari)
8. Re: Looping and control flow (Koen Van Hooreweghe)
----------------------------------------------------------------------
Message: 1
Date: Sun, 10 Mar 2019 19:17:01 +0000
From: Jeremy Roussak <[email protected]>
To: 4D iNug Technical <[email protected]>
Subject: Re: OAuth
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Solved: I wasn’t providing the necessary headers.
Jeremy
On 10 Mar 2019, at 18:49, Jeremy Roussak via 4D_Tech <[email protected]>
wrote:
Miyako,
That was very helpful, thanks, and I’ve now completed that first step of the
“authentication journey”; I can get an authorization code which I can copy and
paste manually, which is fine: it will last for 18 months.
The next step is using the authorization code to get an access token, and I’m
stumbling again. The documentation page
(https://developer.service.hmrc.gov.uk/api-documentation/docs/authorisation/user-restricted-endpoints#installed-applications)
says to do this:
curl -X POST --data \
'client_secret=[YOUR-CLIENT-SECRET]&client_id=[YOUR-CLIENT-ID]&grant_type=authorization_code&redirect_uri=[YOUR-REDIRECT-URI]&code=[AUTHORIZATION-CODE]'
\
https://test-api.service.hmrc.gov.uk/oauth/token
I’ve tried this:
$url:="https://test-api.service.hmrc.gov.uk/oauth/token"
$body:="grant_type=authorization_code"+\
"&client_id="+$clientID+\
"&client_secret="+$clientSecret+\
"&redirect_uri=urn:ietf:wg:oauth:2.0:oob"+\
"&code="+$authCode
$err:=HTTP Request(HTTP POST method;$url;$body;$response)
but all I get is an error saying “grant_type required”. I’ve tried fiddling
with the order of items in $body, but as expected it makes no difference.
I assume I’m not translating the curl example properly into 4D. Help?
Jeremy
On 10 Mar 2019, at 10:04, Keisuke Miyako via 4D_Tech <[email protected]>
wrote:
so the first thing to do is Google the docs with the keyword
"urn:ietf:wg:oauth:2.0:oob"
https://www.google.com/search?client=safari&rls=en&q=site:developer.service.hmrc.gov.uk+urn:ietf:wg:oauth:2.0:oob&ie=UTF-8&oe=UTF-8
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************
------------------------------
Message: 2
Date: Sun, 10 Mar 2019 20:07:12 +0000
From: Peter Mew <[email protected]>
To: 4D iNug Technical <[email protected]>
Subject: Lep Redirect
Message-ID:
<CAO0oOqpgqUPLKTQ_3dyMtc+a=6jjush59aoo9tqxcurjh1c...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Hi
I wonder if anyone can help me with this.
I have a LEP command that reads a file from disc, does some processing
using a program called "shntool", and writes the processed result back to
disc
C_Blob($in;$out)
C_Text($err)
Launch external process(<>PathToShntool+" "+"strip"+" "+"-O always"+"
"+$InputFile+" "+$OutputFile;$In'$out;$err)
This works fine. However I would Like the command to Write to a Blob
instead of the Output File.
There is no output in stdout($out)
Is it possible to do this?
Thanks
-pm
------------------------------
Message: 3
Date: Mon, 11 Mar 2019 01:25:00 +0000
From: Keisuke Miyako <[email protected]>
To: 4D iNug Technical <[email protected]>
Subject: Re: Help LEP macOS to open the Emoji viewer
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
thanks for your informative reply.
I've tried your plugin, but it seems that the plugin only accepts one
modifier key.
This code opens (only with debugger) the macOS Spotlight and close spotlight
after you step over "POST VIRTUAL KEY"
$modifiers:=Command key mask+Control key mask
kVK_Space:=0x0031
POST VIRTUAL KEY (kVK_Space;$modifiers)
it seems the code
CGEventPost(kCGHIDEventTap, e);
cancels the pressed state of control, option, fn, command (but not shift)
implicitly.
I've changed the code to support a combination of modifiers.
https://github.com/miyako/4d-plugin-virtual-key
that said, it will not work in 4D.
you can confirm that the event is sent correctly by calling DELAY PROCESS and
focusing on another app.
------------------------------
Message: 4
Date: Mon, 11 Mar 2019 07:47:14 +0000
From: Bruno LEGAY <[email protected]>
To: [email protected]
Subject: Re: Re: OAuth
Message-ID:
<010201696bb84bfd-b589bfdd-1816-405a-8bfa-172d69ddaa27-000...@eu-west-1.amazonses.com>
Content-Type: text/plain; charset="utf-8"
Hi,
curl -X POST --data \
'client_secret=[YOUR-CLIENT-SECRET]&client_id=[YOUR-CLIENT-ID]&grant_type=authorization_code&redirect_uri=[YOUR-REDIRECT-URI]&code=[AUTHORIZATION-CODE]'
\
https://test-api.service.hmrc.gov.uk/oauth/token
I’ve tried this:
$url:="https://test-api.service.hmrc.gov.uk/oauth/token"
$body:="grant_type=authorization_code"+\
"&client_id="+$clientID+\
"&client_secret="+$clientSecret+\
"&redirect_uri=urn:ietf:wg:oauth:2.0:oob"+\
"&code="+$authCode
$err:=HTTP Request(HTTP POST method;$url;$body;$response)
but all I get is an error saying “grant_type required”. I’ve tried fiddling
with the order of items in $body, but as expected it makes no difference.
I assume I’m not translating the curl example properly into 4D. Help?
Maybe send a content-type :
Content-Type: application/x-www-form-urlencoded
Then, you need to be sure the data you send (the values of your variables) is
properly url encoded...
HTH
Bruno LEGAY
A&C Consulting
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP using GPGMail
URL:
<https://lists.4d.com/mailman/private/4d_tech/attachments/20190311/06d71d20/attachment.sig>
------------------------------
Message: 5
Date: Mon, 11 Mar 2019 05:30:44 -0700 (MST)
From: ADeeg <[email protected]>
To: [email protected]
Subject: Re: Help LEP macOS to open the Emoji viewer
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
4D Tech mailing list wrote
it seems the code
CGEventPost(kCGHIDEventTap, e);
cancels the pressed state of control, option, fn, command (but not shift)
implicitly.
I've changed the code to support a combination of modifiers.
https://github.com/miyako/4d-plugin-virtual-key
that said, it will not work in 4D.
you can confirm that the event is sent correctly by calling DELAY PROCESS
and focusing on another app.
Hi Miyako,
wow so fast. Thanks for your support.
You are right, it does not work with 4D. The char window opens only if I set
the focus outside of 4D and gets hidden when 4D is in foreground again.
So 4D should add the entry inside the edit menu like other mac apps.
And for windows 4d should call the "charmap.exe" from the edit menu
Thanks Armin
--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
------------------------------
Message: 6
Date: Mon, 11 Mar 2019 12:58:46 +0000
From: Keisuke Miyako <[email protected]>
To: 4D iNug Technical <[email protected]>
Subject: Re: Lep Redirect
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
first, you should check the documentation of the command you use,
to see if they support stdOut output. ( " -o - " or something like that)
if not, you might want to consider calling it via bash or some other shell
program.
c.f.
https://kb.4d.com/assetid=77974
https://kb.4d.com/assetid=76658
2019/03/11 5:07、Peter Mew via 4D_Tech <[email protected]>のメール:
Hi
I wonder if anyone can help me with this.
I have a LEP command that reads a file from disc, does some processing
using a program called "shntool", and writes the processed result back to
disc
C_Blob($in;$out)
C_Text($err)
Launch external process(<>PathToShntool+" "+"strip"+" "+"-O always"+"
"+$InputFile+" "+$OutputFile;$In'$out;$err)
This works fine. However I would Like the command to Write to a Blob
instead of the Output File.
There is no output in stdout($out)
Is it possible to do this?
------------------------------
Message: 7
Date: Mon, 11 Mar 2019 14:41:36 -0400
From: Sandor Szatmari <[email protected]>
To: [email protected]
Subject: Looping and control flow
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Does 4D have the concept of continue like
while (something)
if (not interested)
continue
// Process what I'm interested in
end while
Sandor Szatmari
Senior Software Developer
Bristol Capital Inc. - InfoPlus
201 746 7215
www.infoplusonline.com
CONFIDENTIALITY NOTICE: This email (and any related attachments) contains
information from InfoPlus (a service of Bristol Capital, Inc.). It is intended
only for the addressee and may contain information that is confidential and/or
otherwise exempt from disclosure under applicable law. If you are not the
intended recipient or are acting as agent for the intended recipient, any use
or disclosure of this communication is prohibited. If you have received this
communication in error, please notify us immediately to arrange for the
appropriate method of returning or disposing of the communication. If our
respective Companies have confidentiality provisions in effect, this email and
the materials contained herein are deemed CONFIDENTIAL and should be treated
accordingly unless expressly provided otherwise.
------------------------------
Message: 8
Date: Mon, 11 Mar 2019 19:50:40 +0100
From: Koen Van Hooreweghe <[email protected]>
To: 4D iNug Technical <[email protected]>
Subject: Re: Looping and control flow
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
From the top of my head. What about:
something:=true
while(something)
if(not interested)
something:=false
else
process
end if
end while
HTH
Koen
Op 11 mrt. 2019, om 19:41 heeft Sandor Szatmari via 4D_Tech
<[email protected]> het volgende geschreven:
Does 4D have the concept of continue like
while (something)
if (not interested)
continue
// Process what I'm interested in
end while
--------------------
Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Aalter
Belgium
tel +32 495 511.653
------------------------------
Subject: Digest Footer
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************
------------------------------
End of 4D_Tech Digest, Vol 142, Issue 16
****************************************