Script checking tools

Discuss and share scripts and script files...
Post Reply
CCarmichael
Posts: 21
Joined: 28 Apr 2022 13:07

Script checking tools

Post by CCarmichael »

Hi,

This might not be the correct section of the forum, but I've managed to create several custom scripts via ChatGPT (
Xyplorer scripts to check.txt
), and due to their complex nature I was wondering whether anyone knew of any online tools that were able to check, and if required, correct custom scripts.

I ask this as I've found that sometimes generated scripts don't work, and then I need to go round in circles trying to find the cause. Often the cause revolves around the indenting/wording, but if there was something that could use to check and fix any issues it would be really helpful.

Thanks very much.
To see the attached files, you need to log into the forum.

altoclef
Posts: 102
Joined: 12 Oct 2012 18:54
Location: Win11 @100%; XY 27.20.1600

Re: Script checking tools

Post by altoclef »

Short answer: No.

However, you can use XYplorer itself to check the syntactical validity of your scripts. I have converted your .txt file into a script file (attached). If you run that file you will get a popup menu containing the names of each of your individual scripts ... BUT there are some extra entries as well. Those extra entries are because I have deliberately left the indenting of parts of the script incorrect. This is an exercise for you to fix the indenting so that only the individual scripts appear in the popup menu :) .

Other syntactical mistakes may cause the script to crash and XY will give you an error message to point you in the right direction.

After that, if you are not sure of whether the scripts actually do what you need them to do, you can put the command step; at the top of an individual script (see "Scenario1Variant1") and then when you run that script XYplorer will pause and you can step through each statement, inspecting the variables to confirm whether at each stage they are holding what you expect/need them to.

"sometimes generated scripts don't work, and then I need to go round in circles trying to find the cause." – yes, that's debugging :) .

If you are not sure what a particular command is doing, then read the help file. After that, if you are stuck on a particular issue, ask here and someone will probably be able to help.

I encourage you to read this helpful thread on scripting: https://www.xyplorer.com/xyfc/viewtopic.php?t=6560
To see the attached files, you need to log into the forum.

CCarmichael
Posts: 21
Joined: 28 Apr 2022 13:07

Re: Script checking tools

Post by CCarmichael »

Hi altoclef,

Thanks very much for your message, and also for the xys file.

The primary reason I asked was because I generated the scripts in ChatGPT and then had to spend around 30-40mins trying to understand why it said they would work only to say "the reason it didn't work was because...".

Having tried my hand at the process again this morning,, this time with Google.com (Ai Mode) at the helm, it seams that if I'm to use AI to create a script I need to create it each step at a time with as much information as I can possibly give it and then ask whether it has any questions. Plus, ensure that I can test it within a test environment.

Thanks again :)

Post Reply