ChatGPT on macOS can now directly edit code - can it work for Filemaker?

Does anyone know if there's a way to interface with this directly in Filemaker? Or CoPilot or any other AIs?

I fail to see how it could interface with FileMaker. Most calculations in FileMaker are barely code, you're not writing hundreds of lines in a calculation, so I don't see much need for it unless you are a beginner needing assistance.

For scripts, I fail to see how it could do that at all given scripts are an XML representation underneath it all - even if it could write XML, it would need some way to actively modify the script in the workspace, just don't see it happening through GPT. Maybe down the track when FileMaker builds some form of co-pilot integration into the product, but until then we would either need to wait, or have it built in.

Also - code is code, when GPT is editing code, it has at it's disposal not only your code, but trillions of lines of other peoples code.

When it comes to FileMaker, it has basically nothing in comparison. It doesn't do a great job as a result and often makes conflated calculations that may or may not work, and even if they work they are written in s uch a horrendous way you wouldn't want to use them.

Plus, writing a script is far more than just code, it has to directly be able to understand your schema, fields, tables, relationships between things, primary keys involved, layouts you have etc to be able to successfully write a working script, there is far more involved. With other code, it's all there in plain sight.

1 Like

I'm not sure if you're just trolling, or why you posted your condescending reply.

I just see most of my friends who are professional coders using it, and wonder if it can make me better at my job, and I feel like I just got blasted for it.

We know that software such as MBS does interface with Filemaker so we know it's possible. I also don't think there's solid data to support your assertion that the benefits to using AI in coding only kicks in at hundreds of lines of code, but even if it was, and the benefits of using it were only useful to "beginners", I don't see how that's a bad thing for the Filemaker platform.

1 Like

I'm definitely not trolling and definitely not trying to be condescending but I think that @weetbicks is pointing out that FileMaker's UI gets in the way. As he said:

Coding in uncompiled text in a language with published language parsers, allows ChatGPT to see and know everything. All it has to do is to read the text. For those IDEs and code editors integrating ChatGPT is as simple as modifying the clipboard, and dynamically redrawing the screen.

In FileMaker, can ChatGPT add or modify tables, table occurrences, relationships, custom functions? FileMaker UI would have to make that information available to ChatGPT, and it would have to allow ChatGPT to make suggestions. In a text file, those suggestions appear in plain text in front of you. How does it do that, and how do you accept or reject changes? It would be a huge challenge for Claris to offer an integration that worked well enough to be a positive benefit.

1 Like

Trying to get a valid custom function created by AI (if non found from anywhere) it never returned anything working (at least for me). I got all kind of snippets back and it even claimed it tested it but it hallucinated more for example argued that arrays are supported etc ...

Yeah I hear it's hard to make it perfect in Filemaker, but I do have code with 50-100 lines of nested let and executeSQL statements that generate TAB files to be emailed and similar things, and when I miss a semicolon or need help finding where I mess up, ChatGPT is very helpful.

It's also done a great job of learning my data structures and can whip up an ExecuteSQL statement wrapped in a LET statement for me. It's definitely cool that it mostly knows my data structure now, so I don't even have to remember the table and field names for some of my clients, and it just "figures it out". Sure sometimes it hallucinates, but hell so do I when trying to remember field names and it's pretty simple to debug when it's back in Filemaker.

I've also used it to fix some Javascript in web views that I have, since I'm very much a Javascript neophyte.

It's saved ME many hours already and helped with some pretty complex reports, bringing my time from hours down to an hour. I still have to proof it, and debug it, but it's been super helpful for someone at my level.

I'm not looking for it to create tables or whatever other things you're talking about, but it would be great if I could just have a sidebar wherever there's a chunk of code that I could say "hey help me with this" when I need it, without round tripping to ChatGPT, or putting it in Visual Studio Code. The roundtrip isn't horrible, but I was just wondering if there were any solutions.

Is your concern that things like this can replace some of the work that require senior Filemaker developers as it learns the code?

1 Like

Trying to get a valid custom function created by AI (if non found from anywhere) it never returned anything working (at least for me). I got all kind of snippets back and it even claimed it tested it but it hallucinated more for example argued that arrays are supported etc ...

It has improved a lot in the past 6-8 months, and it takes some practice to ask the questions correctly to ChatGPT (prompt engineering). The craziest example is it keeps messing up WHILE statements. No matter how many times I correct it, it will do the wrong thing... but oddly enough if I say "you're *#@# stupid" (insert actual swear) then it does it right EVERY TIME.

It's written quite a few fairly complex functions and helped me talk out various ideas in terms of how to structure my code when I say things like "I want to do A, B and C, give me 3-4 possible ways to approach this, and let me know which you think will be most efficient in Filemaker".

1 Like

I've heard that AI engines respond to strong language. This is something I find disconcerting. I would like AI to provide its best response without me having to give it a tongue lashing.

I can see this being really fruitful. Does it provide interesting explanations for the different scenarios?

1 Like

It does provide explanations as to why, but it does also make things up, so you need to use your experience to see if it makes sense.

I usually ask it for web links to back up its claims and read original articles.

It's also better when I ask it for help with Javascript (for example) than Filemaker Scripts just because it knows a LOT more about Javascript.

Also, it doesn't always write the cleanest code, so I'm more apt to use it as a prototype, or for functions that are rarely called. For example, many of my clients are schools that have to report data to the state once or twice a year. If Chat GPT saves me 3 hours and creates a script that takes a minute or so to generate a .CSV file for export, that's absolutely fine, since it only runs twice a year and there's no need for me to spend the extra time optimizing it.

:laughing:

My motto, throughout my entire career, has been "let the computer do the work." If AI can produce competent code, that's a dream come true. There are a lot of things that I can do that AI can't do. If AI can get the code right - fantastic - that gives me even more time to do things that I want to do for myself.

1 Like

I want to stay fit and keep my abilities. I use AI to help me with API calls which have nothing to do with intellectual capability but with some tricky conventional insider knowledge which rarely given by documentation and rather by digging around in forums or tutorials where someone kind of figured out that the fridge only opens when running hot water in the garage …

2 Likes

Trolling? Condescending? Blasting you? I thought it was a pretty balanced and objective response. Apologies if it was not answer you were looking for.

@Malcolm was 100% correct, my point was that the UI of FileMaker and it's distributed nature of development does not lend itself well to AI being able to generate "code" because in FileMaker the code is not just scripting, it's calculations, value lists, fields, auto-enters, relationships, tables, and so on.

It's not to say that this won't change, and there might be specific areas of the product where it could be introduced to help, but any implementation would require some level of integration into the UI of the product - that is all.

I've used AI to help write javascript that is used in FileMaker with great success and so even now it has it's application to FileMaker.

Generation of executeSQL commands, or help writing a specific calculation are other examples of where it can be useful providing your prompt gives enough information about the schema relationships in your solution to help write the function. THis is actually coming to the product in the form of being able to use a script step to query your database and have OpenAI return a SQL query you can use in your system. part of the prompt sent is calculated by adding specific comments to fields in your schema prefixed with an [LLM] tag.

1 Like

Claude Sonnet wrote me a nearly perfect calculation recently. I'm bullish on it being helpful, but I think the responsibility sits on Claris to implement a way for a Copilot/Cursor-style integration to edit our code directly.

The closest i've seen so far is someone working on a chat bot that writes FM scripts and gives you a copy button to copy the script steps as clipboard xml that you can paste in the script workspace. But that's still pretty far from the streamlined code editing integration we see in editors like Cursor or VSCode with copilot.

2 Likes

Direct VS Code integration is the dream.

1 Like

What one sees in the Script Editor is human readable version of the script steps. What is saved in the script is binary data. As you know every script step is parsed by FileMaker to make sure it is correctly formed.

Trying to understand that binary format is a bad idea. On top of that the code behind the Script Editor may change and invalidate a script. A LOT of things happen in the background when you edit a script, I would call that RI, for Real Intelligence.

Have you ever noticed that renaming a field or table does not break a script ?

1 Like

I don't think it's a bad idea. I do script xml splicing and dicing and snippets all the time. You're right that it must be stored as actual script binary to benefit from automatic field/cf/table name changes etc.

I think Claris could feasibly build an inline script writing assistant directly in the script workspace. That would be the place for it because it could use fm's internal parsing/validation process to confirm the correctness of results and even fix them. And it would have access to schema information to augment the prompt.

I'd appreciate if we also had better version control because I'd feel most comfortable letting a tool like that modify my code if I could easily go back to a good checkpoint.

1 Like

Wow. That’s a level I didn’t even consider, I was just thinking of something to edit the uncompiled scripts.

But yes to version control.

What a can of worms.

FileMaker does store and use IDs for most objects but sometimes it uses names. For example, you can copy a script from one file to another. If your script includes Perform Script ["xyz"] and there isn't a script with the correct ID, but there is a script called "xyz" in the file, then it links that script with the Perform Script step.
:crossed_fingers:

1 Like

At this time, the clipboard is pretty much the only way to achieve something meaningful. It is a limitation, but comes with some perks from the scripting environment as we know it. And the clipboard already has a decent reach within the product.

Here is a video that shows some level of integration relying on the clipboard and involving a AI (I assume some customization & training is at play here).

Proof+Geist were already involved with tools relying on the clipboard (such as their 'Generator' tool, so I'm not too surprized to see them take that path. I am surprized that something like this seems within reach. I would really love for something like that to be embedded in the product.

So even if things may be clunky right now, it seems things are progressing at an impressive pace in the AI world. It is worth paying attention to what can be done because the realm of what can be achieved seems to be stretching pretty quickly.

2 Likes

I was trying to train chat got on my database. I had to break the ddr into three files bc of file size upload limits but when I asked it for all instances of a table occurrence in execute sql it didn’t find them all.
It’s not perfect, but the potential is really getting there. Idk if there’s a great way to (for example) have multiple projects with different ddrs and have it known which you’re talking about over time.