Jump to content

Python - Select Folder?


ninjismo

Recommended Posts

Hi! 

I'm writing a shelf tool that allows users on Linux to search a directory and its sub-directories for a certain file-type / keyword.

To do this I've used a readMultiInput like below - 

start_popup = hou.ui.readMultiInput(start_message,
                                    ("Path to Search", "File to Look For"),
                                    initial_contents=(home_dir, ".exr"),
                                    title="File Finder",
                                    buttons=('OK', 'Cancel'),
                                    default_choice=0,
                                    close_choice=1)


In this version of the script, users need to manually type in / paste the directory they want to search, but I'd like for there to be a pop-up dialog allowing users to select a folder, the same way hou.ui.selectFile() allows you to select a file. 

Is there a way to do this? 

Link to comment
Share on other sites

4 hours ago, ninjismo said:

I'd like for there to be a pop-up dialog allowing users to select a folder, the same way hou.ui.selectFile() allows you to select a file. 

hou.ui.selectFile(file_type=hou.fileType.Directory)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...