Hello,
I’m trying to open a file by giving the code a path to follow. Thanks to your suggestions I’m able to reach any folder not inside a SpecialFolder by coding like this:
OpDg = New OpenDialog
result = “/Users/myHD/FLDR1/FLDR2/FLDR”
OpDg.InitialFolder = new FolderItem (result, FolderItem.PathModes.Native)
I have a DeskTopPopUpMenu letting me choose among three files; what I’d like to do, and failing, is having the code open the chosen file, say myFile.wvr, inside that path.but I do not know how to obtain this. It does not work adding /myFile.wvr at the end of the path.
Maybe I should use an altogether different approach op coding. Any help will be appreciated
If you want to do it using a filedialog to choose a file, what you had initially is correct. The user is then presented with your chosen folder, and then chooses the file. What you get back from the filedialog is a folderitem for that file the user selected.
Opening that file is then the next step, and how you do that depends on what you want to do, as @Eric_Williams suggested.
In a way, yes but I also wanted the app to open the file without my intervention (generally speaking, it’s not a good idea but the code is not for distribution).
After an extensive testing I think I managed to do it.
Well then cut out the filedialog step and just do such as:
Var f as FolderItem, ff as TextInputStream
f = new fFolderItem ("/path/to/the/file.abc", FolderItem.PathModes.Native)
ff = new TextInputStream (f)
ff.Open ()