Announcement

Collapse
No announcement yet.

Maxscript help please. Browse files then copy to another folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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\temp\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
    Kind Regards,
    Morne

  • #2
    It looks like the way you are handling the stings containing the paths is causing \t to be converted to its ascii escape code which is a tab.

    The way round it is to use double \\ instead of \ or use string literals. Try copying and pasting these into the listener and you'll see what I mean.
    Code:
    print "w:\work stuff\temp\file1.jpg"
    
    print "w:\\work stuff\\temp\\file1.jpg"
    
    print @"w:\work stuff\temp\file1.jpg"
    Dan Brew

    Comment

    Working...
    X