SCRIPTING

Scripting with ChatGPT 4o

A small struggle but an interesting exercise

A young man fighting with a robot
AI image by ChatGPT 4o from my prompt

Don’t panic. There’s code here, but what it’s really about is getting an AI tool to write code for you. What I learned is that you can get good results, but you have to be very careful in describing what you will give the AI and what the result will be.

Don’t worry about the length either. A lot of it is code you can skip right over.

I like to keep track of my daily earnings and show which stories earned what. As I explained in another post, you can do that with with a spreadsheet although it is fairly clumsy process.

I thought I might be able to give files to ChatGPT and have it do all the work — unfortunately it makes too many mistakes with files even only 100 lines long. So I did the work in a spreadheet for a few days until I became annoyed by how much work that is.

Anything you can do with a spreadsheet can be done with a script. Years ago I did a lot of scripting with Perl and Bash and would have dashed of what is needed for this fairly quickly.

Right now you might be thinking “Oh, not here comes the code! Time to bail!”. No, not really, the rest of this is about what it takes to get working code from the AI.

--

--

Anthony (Tony/Pcunix) Lawrence 👀
Tech and Me, Loving It or Hating It

Retired Unix Consultant. I write tech and humor mostly but sometimes other things. See my Lists if your interests are specific.