Forum Discussion

Philip_Baird's avatar
Philip_Baird
Community Expert
13 years ago

Get name of File object instance


In my Stores > Files collection I have an item AMITestConfiguration_INI which has a fully qualified file name of C:\Users\BairdP\Documents\TestComplete 9 Projects\ARC\Framework\Stores\Files\General\AMITAMITestConfiguration_INIestConfiguration.INI


 


I would like to write a method in JScript with the signature


 


getFullFileName( fileName )


 


which returns the fully qualified file name


 


My intent would be to use is as such


 


var fullFileName = getFullFileName( Files.AMITestConfiguration_INI );


 


Unfortunately, the File object seems horribly lightweight, I can't event seem to get the name "AMITestConfiguration_INI" so I can use Files.FileNameByName()


 


Is there a way to acheive what I am attempting?

1 Reply


  • Hi Phil,


     


    Try using the following example:


    var filePath = Files.FileNameByName("AMITestConfiguration_INI");


    Log.Message("File name is " + filePath);