Page 1 of 1

2 Questions

Posted: 26 Jan 2025 13:03
by Ysl
Hi

I'm asking Chat GPT to do some XY scripts for me (I use User/Manage commands/Run Script with a keyboard shortcut) , sometimes it work but many time, when I execute the script with the keyborad shortcut, I get this list and I really don 't know what it means and what to do with it...(see attachment)

Also at the end of this script which create a folder, move the file to it and open the folder, I would like to know how to select the file, like if I click on it ?

Thanks for your help

Ysl

Re: 2 Questions

Posted: 26 Jan 2025 13:23
by highend
Indent the lines…

Re: 2 Questions

Posted: 26 Jan 2025 13:54
by Ysl
Oh yes, thank you ! With a space in the front of the script I do not have this list appearing (which I still don't know what's the use of it)

Also I would like to know which script command will select the file, like if I click on it ?

Re: 2 Questions

Posted: 26 Jan 2025 17:34
by highend
01. Beging your script with
setting "BackgroundFileOps", 0;

02. Activate:
Menu - Scripting - [x] Syntax Checking

03. The goto command (used with a file) will already select it

Re: 2 Questions

Posted: 27 Jan 2025 10:53
by Raf
Ysl wrote: 26 Jan 2025 13:03 Hi

I'm asking Chat GPT to do some XY scripts for me (I use User/Manage commands/Run Script with a keyboard shortcut) , sometimes it work but many time, when I execute the script with the keyborad shortcut, I get this list and I really don 't know what it means and what to do with it...(see attachment)
AI is a helpful tool. It is important to remember that it is not yet capable of completing tasks independently. It may be beneficial to consider acquiring proficiency in XY language and leveraging chatGPT to assist in script development. Then you should analyse code from AI, ask it to make edits, and finally finish the script yourself. It's important to note that this is only possible if you know the nuances of the language.

Re: 2 Questions

Posted: 28 Jan 2025 13:39
by Ysl
highend wrote: 26 Jan 2025 17:34 01. Beging your script with
setting "BackgroundFileOps", 0;

02. Activate:
Menu - Scripting - [x] Syntax Checking

03. The goto command (used with a file) will already select it
Thank you for your help but I'm still stuck...Maybe you could adapt my screen below to make the file moved to the created directory selected, as if y clicked on it please ?

// Récupérer le nom et le chemin complet du fichier sélectionné
$selectedFile = <curitem>;

// Récupérer le nom sans extension du fichier sélectionné, en conservant les chiffres
$fileNameNoExt = <curbase>; // Pas besoin de supprimer l'extension manuellement car <curbase> le fait déjà

// Récupérer le chemin du dossier contenant le fichier
$folderPath = <curpath>;

// Créer un nouveau dossier avec le même nom que le fichier (y compris les chiffres)
new($folderPath . "\" . $fileNameNoExt, "dir");

// Déplacer le fichier dans le nouveau dossier
moveto $folderPath . "\" . $fileNameNoExt, $selectedFile;

// Ouvrir le nouveau dossier
goto $folderPath . "\" . $fileNameNoExt;

Re: 2 Questions

Posted: 28 Jan 2025 14:05
by highend

Code: Select all

setting "BackgroundFileOps", 0;
    $fileName = <curname>;
    $dstPath  = <curpath> . "\" . <curbase>;
    moveto $dstPath, <curitem>, , 2, 2;
    goto $dstPath . "\" . $fileName;

Re: 2 Questions

Posted: 28 Jan 2025 14:10
by Ysl
Perfect ! Thank you :)

Re: 2 Questions

Posted: 09 Mar 2025 12:26
by Ysl
hi

thanks again for the script !

Could you add this at the end please :

press Delete
press Enter

Best Regards

ysl

Re: 2 Questions

Posted: 09 Mar 2025 12:31
by highend