Mlabbe/nativefiledialog julia wrapper
Author Suavesito-Olimpiada
21 Stars
Updated Last
1 Year Ago
Started In
October 2021


Build Status Coverage

Wrapper of the library mlabbe/nativefiledialog for opening native OS dialogues for selecting files (or Gtk for Linux/FreeBSD). Inspired by this discourse post.


To install NativeFileDialog.jl, in the Julia REPL

julia> using Pkg
julia> Pkg.add("NativeFileDialog")


NativeFileDialog.jl export four functions

pick_file(path=""; filterlist="")

pick_multi_file(path=""; filterlist="")


save_file(path=""; filterlist="")

The documentation of every one of these can be consulted in help mode in the REPL (press ? to change to help mode, backspace to exit), although their names are really descriptive.

Path selection

The path positional argument sets the directory in which the dialog will be open, by default path is set to "" and the default open point is operating system dependent.

The path argument accepts AbstractPaths from FilePathsBase.jl. When a <:AbstractPath has been passed it returns nothing on cancellations for every one of the functions.

File filter lists

The filterlist keyword argument allows you to define multiple extension filters for the dialogues. The syntax for doing this is "ext1,ext2;ext3" where ext1 and ext2 are extensions of the first filter list and ext3 is an extension for the second one.

Notice that multiple extensions for one list are separated by a comma (,), while the different lists are separated by a semicolon (;).

By default filterlist is set to "" which means all kind of files are accepted.


julia> using NativeFileDialog

julia> using FilePathsBase

julia> pick_file()

julia> pick_file(home()) # from FilePathsBase

julia> pick_file()
"" # cancelled selection

julia> pick_multi_file()
2-element Vector{String}:

julia> pick_folder()

Required Packages