{"id":2532,"date":"2010-02-19T17:32:49","date_gmt":"2010-02-19T17:32:49","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2010\/02\/19\/file-and-folder-selection-gui\/"},"modified":"2010-02-19T17:32:49","modified_gmt":"2010-02-19T17:32:49","slug":"file-and-folder-selection-gui","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2010\/02\/19\/file-and-folder-selection-gui\/","title":{"rendered":"File and Folder Selection GUI"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction><\/introduction>\r\n   <p>This week's Pick of the Week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/10867-uipickfiles--uigetfile-on-steroids\">uipickfiles<\/a>, by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/22680\">Douglas Schwarz<\/a>.\r\n   <\/p>\r\n   <p>You may have noticed that we--that is, Bob, Jiro, and I--tend to Pick a lot of GUI tools. Though niche tools have their places,\r\n      basic GUI components tend to be widely useful. Today's Pick is no exception.\r\n   <\/p>\r\n   <p>Doug refers to his file as \"<a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009b\/techdoc\/ref\/uigetfile.html\">uigetfile<\/a> on steroids\". No argument here; this function allows selection of files OR folders (in the non-exclusive sense of the term\r\n      \"or\"), using a GUI to navigate easily around one's directories.\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/uipickfiles.png\"> <\/p>\r\n   <p>Doug tested his file on both Windows (XP) and Mac (OS X) platforms; I'll take his word for it that it works on the Mac. (As\r\n      he points out, it is implemented entirely in MATLAB, so it should be platform-independent.) I did take it for a test drive\r\n      on my Windows XP machine, and really liked the nice file-and-folder-picking (and list-sorting) interface. Uipickfiles facilitates\r\n      filtering (including regular-expression filtering), and allows the user to select the class of the output--as cells, structures,\r\n      or character arrays.\r\n   <\/p>\r\n   <p>I particularly like how nicely Doug's code is implemented, commented, and documented. Very nice work, Doug!<\/p>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2532#respond\">Comments?<\/a><\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_7f343eb8c2a9466c949468ff6f3ca4cb() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='7f343eb8c2a9466c949468ff6f3ca4cb ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 7f343eb8c2a9466c949468ff6f3ca4cb';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Brett Shoelson';\r\n        copyright = 'Copyright 2010 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_7f343eb8c2a9466c949468ff6f3ca4cb()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.9<br><\/p>\r\n<\/div>\r\n<!--\r\n7f343eb8c2a9466c949468ff6f3ca4cb ##### SOURCE BEGIN #####\r\n%% File and Folder Selection GUI\r\n%%\r\n% This week's Pick of the Week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/10867-uipickfiles--uigetfile-on-steroids uipickfiles>, \r\n% by <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/22680 Douglas Schwarz>.\r\n%%\r\n% You may have noticed that weREPLACE_WITH_DASH_DASHthat is, Bob, Jiro, and IREPLACE_WITH_DASH_DASHtend to Pick a\r\n% lot of GUI tools. Though niche tools have their places, basic GUI\r\n% components tend to be widely useful. Today's Pick is no exception.\r\n\r\n%%\r\n% Doug refers to his file as <https:\/\/www.mathworks.com\/help\/releases\/R2009b\/techdoc\/ref\/uigetfile.html \"uigetfile> on steroids\". No argument here;\r\n% this function allows selection of files OR folders (in the non-exclusive\r\n% sense of the term \"or\"), using a GUI to navigate easily around one's\r\n% directories. \r\n\r\n%%\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/uipickfiles.png>>\r\n% \r\n\r\n%%\r\n% Doug tested his file on both Windows (XP) and Mac (OS X) platforms; I'll\r\n% take his word for it that it works on the Mac. (As he points out, it is\r\n% implemented entirely in MATLAB, so it should be platform-independent.) I\r\n% did take it for a test drive on my Windows XP machine, and really liked the nice file-and-folder-picking\r\n% (and list-sorting) interface. Uipickfiles facilitates filtering (including\r\n% regular-expression filtering), and allows the user to select the class of the outputREPLACE_WITH_DASH_DASHas cells, structures, or character arrays.\r\n\r\n%%\r\n% I particularly like how nicely Doug's code is implemented, commented, and\r\n% documented. Very nice work, Doug!\r\n\r\n%%\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2532#respond Comments?>\r\n##### SOURCE END ##### 7f343eb8c2a9466c949468ff6f3ca4cb\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n   This week's Pick of the Week is uipickfiles, by Douglas Schwarz.\r\n   \r\n   You may have noticed that we--that is, Bob, Jiro, and I--tend to Pick a lot of GUI tools. Though niche tools have... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2010\/02\/19\/file-and-folder-selection-gui\/\">read more >><\/a><\/p>","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2532"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2532"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2532\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}