Re: Help LEP macOS to open the Emoji viewer

2019-03-10 Thread Keisuke Miyako via 4D_Tech
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.


**
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
**

Lep Redirect

2019-03-10 Thread Peter Mew via 4D_Tech
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
**
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
**

Re: OAuth

2019-03-10 Thread Jeremy Roussak via 4D_Tech
Solved: I wasn’t providing the necessary headers.

Jeremy

> On 10 Mar 2019, at 18:49, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> 
> 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]_id=[YOUR-CLIENT-ID]_type=authorization_code_uri=[YOUR-REDIRECT-URI]=[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"+\
> "_id="+$clientID+\
> "_secret="+$clientSecret+\
> "_uri=urn:ietf:wg:oauth:2.0:oob"+\
> "="+$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 <4d_tech@lists.4d.com> 
>> 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=en=site:developer.service.hmrc.gov.uk+urn:ietf:wg:oauth:2.0:oob=UTF-8=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:4d_tech-unsubscr...@lists.4d.com
> **

**
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
**

Re: OAuth

2019-03-10 Thread Jeremy Roussak via 4D_Tech
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]_id=[YOUR-CLIENT-ID]_type=authorization_code_uri=[YOUR-REDIRECT-URI]=[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"+\
"_id="+$clientID+\
"_secret="+$clientSecret+\
"_uri=urn:ietf:wg:oauth:2.0:oob"+\
"="+$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 <4d_tech@lists.4d.com> 
> 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=en=site:developer.service.hmrc.gov.uk+urn:ietf:wg:oauth:2.0:oob=UTF-8=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:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows Build - STR# 10135, 18/19 Folders

2019-03-10 Thread John J Foster via 4D_Tech
Hi Randy,

Thanks! I’ll send it to you via your email and reduce my NUG noise. 

Appreciate,
John…


> I'll be glad to look at your buildapp.xml file if you want to send it to me.
> 
> Randy Engle

**
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
**

4D Server v17.1 and time change

2019-03-10 Thread Jeffrey Kain via 4D_Tech
Did anyone else have any weirdness with their 4D Server v17.1 and the change to 
Daylight Savings Time this morning?

Most, but not all, of our users got disconnected around the time of the change, 
the SQL server and the 4D Server UDP port that broadcasts the server name 
stopped responding (we have Nagios checks on both of these and they both 
started alerting), and when we went to quit 4D Server it just quit immediately 
without giving the usual chance for a countdown.

Could be a fluke I guess? But it seems awfully suspicious that it happened 
right around the time change, so I'm just curious if anyone else saw anything 
weird?

Jeff
**
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
**

RE: Windows Build - STR# 10135, 18/19 Folders

2019-03-10 Thread Randy Engle via 4D_Tech
John,

On our system:
(Windows 10 4D 17r4)
(We are 100% windows, creating new builds 3x week)

On Windows, the built app creates a folder:  "AppName"
This has the "Appname.exe" in it

Inside of that folder is another folder:  "Database"  This holds the 
.4DC/.4Dindy files

Clicking on the .EXE works just fine

Don't know about the "appname.4Dbase" folder
Something in the buildapp.xml?

I'll be glad to look at your buildapp.xml file if you want to send it to me.

Randy Engle

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of John J Foster via 
4D_Tech
Sent: Sunday, March 10, 2019 6:15 AM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: John J Foster 
Subject: Windows Build - STR# 10135, 18/19 Folders

Hey All,

I couldn’t find anything in KB that explained this situation.

Windows 10 - 4D v17r4

I just noticed that the build of an engined version of my app creates two 
foldersnamed:

STR# 10135, 18 -> Appname.4dbase -> includes the .4DC/.4DIndy files STR# 10135, 
19 -> Appname -> includes executable

Is this related to the application build XML or JSON file?

I haven't had to create a standalone app on windows since 
DataPulse/StructurePulse 10 years ago. And it looks like I will need both of 
these folders as part of the “App”.

Can they just be renamed and then included in another folder? And isn’t there a 
way of creating a file (an alias like) where the client will click that and the 
app will work? I really like to keep them out of these folders.

Does an install program on windows manage these pieces as well.

If you have experience creating a standalone app on windows I’d appreciate any 
help. Any time saved is huge at this point.

Thanks for your help,
John…
**
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
**

**
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
**

Re: CONVERT PICTURE v17

2019-03-10 Thread Randy Jaynes via 4D_Tech
You have to be careful about the transparency, though.

After doing this conversion with transparency, I found that some of our 
pictures in the picture library (and static pictures on forms) need white in 
some areas to be meaningful. So we had to carefully look at each one to be sure 
that transparency conversion didn’t take anything away and redesign the ones 
that needed white put back in certain areas.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com  • 845.687.3741 • PrintPoint, Inc 
• 57 Ludlow Lane • Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 






> On Mar 9, 2019, at 9:35 PM, Charles Miller via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> You need to do convert in 32 bit and make sure to take care of transparency
> Chuck
> 
> On Sat, Mar 9, 2019 at 2:17 PM Wayne Stewart via 4D_Tech <
> 4d_tech@lists.4d.com > wrote:
> 
>> Are you running the code in 32 bit mode on a computer with QuickTime
>> installed?
>> 
>> On Sat, 9 Mar 2019 at 19:27, David Garrard via 4D_Tech <
>> 4d_tech@lists.4d.com >
>> wrote:
>> 
>>> I have some legacy pictures fields with .PICT pictures in them in my
>>> Windows database that I am converting to v17 64 bit.  Here is my code to
>>> convert the pictures to JPG format.
>>> 
>>> ALL RECORDS([DOCC_Document])
>>> For ($i;1;Records in selection([DOCC_Document]))
>>> GOTO SELECTED RECORD([DOCC_Document];$i)
>>> GET PICTURE FORMATS([DOCC_Document]Document_Icon;$aTPictureFormats)
>>>CONVERT PICTURE([DOCC_Document]Document_Icon;".jpg")
>>> SAVE RECORD([DOCC_Document])
>>> End for
>>> 
>>> The documentation suggests that this would convert the pictures in the
>>> database to jpg format and they would lose the "ugly big cross on PICT"
>>> replacement icon.  But I see no changes.
>>> 
>>> I must be doing something fundamentally wrong... Any ideas?
>>> 
>>> David Garrard
>>> **
>>> 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 
>>> 
>>> **
>> 
>> --
>> 
>> Regards,
>> 
>> Wayne
>> **
>> 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 
>> 
>> **
> 
> -- 
> -
> Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
> Informed Solutions, Inc.
> Brookline, MA 02446 USA Registered 4D Developer
>   Providers of 4D, Sybase & SQL Server connectivity
>  http://www.informed-solutions.com 
> 
> -
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any action in
> reliance upon this transmission is strictly prohibited.  Delivery of this
> message to any person other than the intended recipient shall not
> compromise or waive such confidentiality, privilege or exemption
> from disclosure as to this communication.
> **
> 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 
> 
> **

**
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

Re: Highlighting rows using Row Font Color Array

2019-03-10 Thread macjimbo via 4D_Tech
Thanks for the pointers to the blog; surprised 4D doesn't just reverse out in
white when a non-standard text colour is used. But it doesn't… Thanks again.



--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
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
**

Windows Build - STR# 10135, 18/19 Folders

2019-03-10 Thread John J Foster via 4D_Tech
Hey All,

I couldn’t find anything in KB that explained this situation.

Windows 10 - 4D v17r4

I just noticed that the build of an engined version of my app creates two 
foldersnamed:

STR# 10135, 18 -> Appname.4dbase -> includes the .4DC/.4DIndy files
STR# 10135, 19 -> Appname -> includes executable

Is this related to the application build XML or JSON file?

I haven't had to create a standalone app on windows since 
DataPulse/StructurePulse 10 years ago. And it looks like I will need both of 
these folders as part of the “App”.

Can they just be renamed and then included in another folder? And isn’t there a 
way of creating a file (an alias like) where the client will click that and the 
app will work? I really like to keep them out of these folders.

Does an install program on windows manage these pieces as well.

If you have experience creating a standalone app on windows I’d appreciate any 
help. Any time saved is huge at this point.

Thanks for your help,
John…
**
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
**

Re: Help LEP macOS to open the Emoji viewer

2019-03-10 Thread ADeeg via 4D_Tech
4D Tech mailing list wrote
> P.S.
> 
> to post keystrokes programmatically
> 
> https://github.com/miyako/4d-plugin-virtual-key
> 
> to do it the proper way (it seems, not tested)
> 
> https://developer.apple.com/documentation/appkit/nsapplication/1428455-orderfrontcharacterpalette?language=objc

Magic Miyako, a plugin for everything :-)

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)



Second observation: It seems that 4D blocks this keycode combination, cause
4D adds no entry into the edit menu like other apps. (Word, Excel, OutLook,
Apple Mail, Textedit, ...) all other apps adds the entry to the edit menu.
Why not 4D ?

macOS 10.12.6 
4D v16.4hf1
4D v17r4


Thanks Armin





--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
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
**

Re: OAuth

2019-03-10 Thread Keisuke Miyako via 4D_Tech
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=en=site:developer.service.hmrc.gov.uk+urn:ietf:wg:oauth:2.0:oob=UTF-8=UTF-8

> oob callbacks




**
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
**

Re: OAuth

2019-03-10 Thread Keisuke Miyako via 4D_Tech
if  the service provider does not support oob callbacks
then you need to start a TCP listener session on localhost.

c.f.

https://github.com/miyako/console-tcp-listener

of course you can use 4D Internet Commands or the built-in web server.

if oob is supported (you need to check with the service provider)
the user will be redirected to a web page that says something to the effect of,
"type this code in your desktop application".

OAuth is primarily designed for web applications,
that prefer to delegate authorisation and authentication to a trusted account 
agent,
so it assumes that the application is hosted by a web server,
anything else, like a desktop application,
is considered out-of-bounds re protocol.

> 2019/03/10 17:51、Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com>のメール:
> I’m floundering in the sea of my ignorance, so any help would be gratefully 
> received. What, in 4D, should I do get get the authorisation results (step 2 
> in the reference)?




**
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
**

OAuth

2019-03-10 Thread Jeremy Roussak via 4D_Tech
I’m trying to get an OAuth 2.0 access token. I’m confused about the redirect 
uri and how to implement it in 4D. The server I’m hoping to talk to is the 
Value Added Tax server at HMRC in England (in a couple of months’ time, 
entering figures for VAT returns will have to be done by software rather than 
online, by hand, at present). The spec is here:

https://developer.service.hmrc.gov.uk/api-documentation/docs/authorisation/user-restricted-endpoints#installed-applications

I’m floundering in the sea of my ignorance, so any help would be gratefully 
received. What, in 4D, should I do get get the authorisation results (step 2 in 
the reference)?

Jeremy
**
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
**