Re: ChatGPT for LC scripting

2025-03-11 Thread Tom Glod via use-livecode
Just FYI,

For Livecode, Claude is THE BEST, by alot.
It is often successful when the others fail.

Cheers,
Tom

On Thu, Mar 6, 2025 at 12:19 PM Sean Cole via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Craig,
>
> For example, I needed to integrate the Docusign SOAP API into a current
> project. Rather than hunt through the pages and pages of API guides, which
> are usually very C+, C# or PHP centric, I type the following into the
> ChatGPT prompt:
>
> Create a LiveCode script for version 9.0.2 that will create a document in
> Docusign using the SOAP 1.2 API
>
> Along with some prerequisites and initial information it gave me this
> script:
>
> on mouseUp
>-- Define DocuSign SOAP Endpoint
>put "https://demo.docusign.net/api/3.0/soap.asmx
> <
> https://geotrack.email/ext/l?idx=KtW4U2OV61wz99QT0Xey&ret=https%3A%2F%2Figafnl.com%2Fclick%3Fredirect%3Dhttps%253A%252F%252Fdemo.docusign.net%252Fapi%252F3.0%252Fsoap.asmx%26dID%3D1741281488193%26hashId%3D833f6d0a790a0f350fafc9657559596d1af63e4a4a4768afffa5f700dc69ff31f2bc3e%26linkName%3Dhttps%3A%2F%2Fdemo.docusign.net%2Fapi%2F3.0%2Fsoap.asmx
> >"
> into tURL
>
>-- DocuSign Credentials
>put "your-em...@example.com" into tUsername
>put "your-password" into tPassword
>put "your-integrator-key" into tIntegratorKey
>put "your-account-id" into tAccountID
>
>-- Create Authentication Header (Base64 encoded)
>put "" & tUsername &
> "" & tPassword & "" &
> tIntegratorKey & "" into tAuthHeader
>put base64Encode(tAuthHeader) into tEncodedAuth
>
>-- SOAP Envelope for Sending Document
>put "" & \
>" " & \
>"xmlns:xsd='http://www.w3.org/2001/XMLSchema
> <
> https://geotrack.email/ext/l?idx=KtW4U2OV61wz99QT0Xey&ret=https%3A%2F%2Figafnl.com%2Fclick%3Fredirect%3Dhttp%253A%252F%252Fwww.w3.org%252F2001%252FXMLSchema%26dID%3D1741281488193%26hashId%3D833f6d0a790a0f350fafc9657559596d1af63e4a4a4768afffa5f700dc69ff31f2bc3e%26linkName%3Dhttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema
> >'
> " & \
>"xmlns:soap12='http://www.w3.org/2003/05/soap-envelope
> <
> https://geotrack.email/ext/l?idx=KtW4U2OV61wz99QT0Xey&ret=https%3A%2F%2Figafnl.com%2Fclick%3Fredirect%3Dhttp%253A%252F%252Fwww.w3.org%252F2003%252F05%252Fsoap-envelope%26dID%3D1741281488193%26hashId%3D833f6d0a790a0f350fafc9657559596d1af63e4a4a4768afffa5f700dc69ff31f2bc3e%26linkName%3Dhttp%3A%2F%2Fwww.w3.org%2F2003%2F05%2Fsoap-envelope
> >'>"
> & \
>"" & \
>""
> & \
>"" & tUsername & "" & \
>"" & tPassword & "" & \
>"" & tIntegratorKey & "" & \
>"" & \
>"" & \
>"" & \
>""
> & \
>"" & tAccountID & "" & \
>"" & \
>"Test LiveCode DocuSign Envelope" & \
>"Please sign this document" & \
>"" & \
>"" & \
>"1" & \
>"TestDocument.pdf" & \
>"" & base64Encode(URL "binfile:test.pdf") & ""
> & \
>"" & \
>"" & \
>"" & \
>"" & \
>"1" & \
>"Signer Name" & \
>"sig...@example.com" & \
>"Signer" & \
>"1" & \
>"" & \
>"" & \
>"" & \
>"" & \
>"1" & \
>"1" & \
>"100" & \
>"150" & \
>"SignHere" & \
>"" & \
>"" & \
>"Sent" & \
>"" & \
>"" & \
>"" & \
>"" into tSOAPRequest
>
>-- Set HTTP Headers
>put "POST" into tMethod
>put "Content-Type: application/soap+xml; charset=utf-8" into tHeaders
>put "SOAPAction: http://www.docusign.net/API/3.0/CreateEnvelope
> <
> https://geotrack.email/ext/l?idx=KtW4U2OV61wz99QT0Xey&ret=https%3A%2F%2Figafnl.com%2Fclick%3Fredirect%3Dhttp%253A%252F%252Fwww.docusign.net%252FAPI%252F3.0%252FCreateEnvelope%26dID%3D1741281488193%26hashId%3D833f6d0a790a0f350fafc9657559596d1af63e4a4a4768afffa5f700dc69ff31f2bc3e%26linkName%3Dhttp%3A%2F%2Fwww.docusign.net%2FAPI%2F3.0%2FCreateEnvelope
> >"
> & cr into tHeaders
>
>-- Send the SOAP Request
>put tsNetPostSync(tURL, tMethod, tSOAPRequest, tHeaders) into tResponse
>
>-- Check for Errors
>if the result is not empty then
>   answer "Error: " & the result
>else
>   put tResponse into tEnvelopeResponse
>   -- Extract Envelope ID from Response
>   put lineOffset("", tEnvelopeResponse) into tStart
>   put lineOffset("", tEnvelopeResponse) into tEnd
>   if tStart > 0 and tEnd > 0 then
>  put char (tStart + 11) to (tEnd - 1) of tEnvelopeResponse into
> tEnvelopeID
>  answer "Document sent! Envelope ID: " & tEnvelopeID
>   else
>  answer "Failed to retrieve Envelope ID."
>   end if
>end if
> end mouseUp
>
> It's most of the way there and certainly answers my specific question. Of
> course, you can ask follow-up questions to create authentication scripts,
> add Tabs to the premade forms, and set other variables where needed. After
> the code provided, the explanation also explains how it works and 

ChatGPT for LC scripting

2025-03-11 Thread Pi Digital via use-livecode
Whoever trained ChatGPT into coding for LC I want to say a big Thank You. It is 
now my primary way to code. Even more fun when you use the Reason 
functionality. 

I am primarily coding in LC9.0.2 as I am disillusioned by 10 and the future of 
LC. But with a little security hack for 9.0.2 it works just fine with the 
latest web security protocols. And ChatGPT can be asked to code for 902 
specifically. I have been very, very impressed with the outputs with incredible 
explanations and step by step guides for a whole range of tasks. LC was already 
the single fastest coding platform but now 10x faster than that using ChatGPT4. 

Thanks again. 

Sean Cole
Pi Digital
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode