Please help me to create a script that allows the user to select a folder with files.
Then loops through the files, makes a copy of the file in a new folder
and automatic renames each file with the prefix as "1234" at the beginning and then the original name thereafter.
Eg. File : Test.PDF
after rename file name : 1234Test.PDF
You could
a) Get a list of the files in the user selected folder
b) loop through the list inserting the files into a container and using export field contents to export them from the container to the other folder. You can rename the file during the export if you use a $Path variable
a) is the main problem. You can do a) with only FileMaker Native script steps only if the folder is located inside documents as you could used Get ( DocumentsPathListing ) to find the selected folder and parse out the needed list of files and file paths. Outside of Documents, you need either a system script or a plug in that can list the contents of a specified folder. With all of these methods, I believe that Get Directory might be used to select the directory from which to list files. The details of a) will depend on the method you select.