Notifications
Clear all

[Closed] Maxscript help please. Browse files then copy to another folder

Hi all

Can somebody lend a hand please.
I want to have a dialog that prompts the user to browse for files, then it will add those files to a listbox. They can add to this list after the initial browse.

FOr example, the user will browse to “w:\work” and select 2 or 3 files from there and add it to the list. Then they will also browse to a UNC path for example “\server\stuff” and select files from here.
The files from the 1st browse together with the files from the 2nd browse should be displayd in a list. When “selection” is done. All those files from drive paths as well as UNC path, should all be copied to a single location.

I’m testing just the copy part, using “copyfile file1 file2”. This copies one file from one location to another. The problem is if the path is for example “w:\work stuff emp\file1.jpg”, then the result is max sees that path as “w:\work stuff emp\file1.jpg”

The “/t” is picked up as 3 spaces.
I could use dos commands, but then how do I deal with the UNC paths?

Some insight and possibly some examples will help a lot please for the browsing files and adding to a list to copying etc

2 Replies

Well, when inputting the string manually, use verbatim string literal, i.e. @“w:\work stuff emp\file1.jpg” instead of “w:\work stuff emp\file1.jpg”

When getting the input from dialog (), you won’t have that problem.

For the rest, External File Methods topic in maxscript reference is a good start.

You can use the UI from this script: http://miauumaxscript.blogspot.bg/2015/06/miauus-batch-save-obj-as-max-files.html .

Modify it to browse for fodler where to copy the files.