How can I create a list of the files in a Windows directory?

I think I read a post where a user was trying to get a list of files in a Windows directory. I haven't been able to locate it since. I apologize if this is a duplicate post...

I am scripting an application in Windows. I would like to be able to get a list of the files automatically and have the script process them. I am not interested in the order. The files in the folder will change from time to time and I don't want to edit the script each time this happens. Basically I want:
1. List of files in the directory
2. Names for later output in a result file with my formatting

Having the name of each file is important, which is why I can't do this by image. I have considered:

1. Connect to the network volume where the files reside from the Macintosh
2. Get a list of the files
3. Use type to enter the names into the appropriate field in the application on the Windows SUT.

I haven't tried this yet since I am hoping there is an elegant way to do it.

I would love to hear any suggestions.

Thanks in advance

Comments

  • The easy solution would be to mount the windows volume via smb. This would require that remote sharing be enabled on the appropriate folder(s) on your windows FS: on your Windows' system, Right Click the folder > Properties > Sharing.

    Next, you need to mount this drive via smb://"theserveraddresshere" via OS Xs Finder > Go > Connect to Server panel.

    Once the volume is mounted you can then access the directory list via the SenseTalk shell command.
    put shell("ls /path/to/volume") into file "path/to/someFile"
    
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    Right. Actually, once the remote file system is mounted to the Eggplant machine, you can also use any of the SenseTalk file and file system access mechanisms described in chapter 14 of the SenseTalk Reference manual.

    So, in your case you might do something like this:
    put files("/mounted/path/to/remote/directory") into fileList
    
    repeat with each filename in fileList
        click "appFilenameField"
        typeText filename & return
    end repeat
    
  • Thank you both very much! This little bit will save me a lot of time.

    Regards,
Sign In or Register to comment.