FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Using Windows Copilot from FWH apps!
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Using Windows Copilot from FWH apps!
Posted: Fri Oct 13, 2023 07:57 PM
copilot.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   ShellExecute( 0, "open", "microsoft-edge://?ux=copilot&tcp=1&source=taskbar" )
   SysWait( 1 )
   CreateObject( "WScript.Shell" ):SendKeys( "tell me latest news~" )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Using Windows Copilot from FWH apps!
Posted: Fri Oct 13, 2023 10:02 PM

Dear Antonio,

This is very interesting. Thank you very much.

It works, but I don't see where it creates the exe.

Possibly it's being deleted by my antivirus software right away?

Antonio, do you think one can also query the responses?

I am using this approach with mod harbour but I add my prompts with copy and paste. The problem with the API key is that there is no cost overview.

Best regards,

Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Using Windows Copilot from FWH apps!
Posted: Sat Oct 14, 2023 06:17 AM

Dear Otto,

Here it properly creates the EXE and runs fine

> Possibly it's being deleted by my antivirus software right away?

Yes, probably

> Antonio, do you think one can also query the responses?

We need to find the Windows Copilot keys shortcut to copy the responses

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Using Windows Copilot from FWH apps!
Posted: Mon Oct 16, 2023 02:28 PM
One step further. Now we need to find out when Copilot ends answering...

copilot.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   ShellExecute( 0, "open", "microsoft-edge://?ux=copilot&tcp=1&source=taskbar" )
   SysWait( 5 )
   CreateObject( "WScript.Shell" ):SendKeys( "what time is it ?~" )
   SysWait( 15 )
   CreateObject( "WScript.Shell" ):SendKeys( "{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}~" )
   MsgInfo( TClipBoard():GetText() )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Using Windows Copilot from FWH apps!
Posted: Mon Oct 16, 2023 05:09 PM

Dear Antonio,

Couldn't one download the entire website and then use the last answer?

I tried to write into the prompt: Create a capitio: "Answer to question: 100"

Then I could search for "Answer to question: 100" and download from the html.

Best regards,

Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Using Windows Copilot from FWH apps!
Posted: Mon Oct 16, 2023 05:46 PM

Dear Otto,

Once copilot answers, please press tab until you reach a "copy" button then press enter

thats what the above code does and it should place the answer in the clipboard

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Using Windows Copilot from FWH apps!
Posted: Tue Oct 17, 2023 08:38 AM
Dear Antonio,
Thank you for dedicating so much time to the topic of AI for us and making it accessible to us.

Now it's getting insane.
I took a screenshot of the login screen from the video and asked ChatGPT to create such a screen for me.

Best regards,
Otto

https://www.facebook.com/groups/modharbour.club/?multi_permalinks=1433414803879409&notif_id=1697487131028802

Continue the discussion