ShowOpenFileDialog: How to set file extension filter AND default path?

Hi

I have created a small method choosing a file (restricted by a specific extension) by ShowOpenFileDialog:

[code]// Choose a PRG file
Var PrgType As New FileType
PrgType.Name = “program/prg”
PrgType.Extensions = “PRG”

Var PrgPath As FolderItem = FolderItem.ShowOpenFileDialog(PrgType)
…[/code]

This is all working fine. Now I want to additionally set a predefined path that will show up on FolderItem.ShowOpenFileDialog. I can’t find such an option in the documentation.

Is there a way to set a predefined path to open the ShowOpenFileDialog at that position?

see .InitialFolder
https://documentation.xojo.com/api/files/folderitem.htmlDialog

Excellent, thank you! I will set your answer as correct as it answers my question and works (tried out). This brought me to the option “FolderItem.PathModes.Native”. So I tried that in my existing code and it’s working as well! The ShowOpenDialog is taking over the path from the associated FolderItem.

[code]// Choose a PRG file
Var PrgType As New FileType
PrgType.Name = “program/prg”
PrgType.Extensions = “PRG”

Var PrgPath As New FolderItem("<any_native_path>", FolderItem.PathModes.Native)

PrgPath = FolderItem.ShowOpenFileDialog(PrgType)
…[/code]

Thanks!