if (do_name() != 'Home') : ?>
endif ?>
Posted by chris on Mar 07, 2008
the last underscore: ... types_(None, ...
file_path will end up with as many files
as you select, so you may end up with more
than one after the return!
sorry, but i lost the end of one of the lines.
i'll be more careful next time. here's the
whole line:
result = filebrowser.runModalForDirectory_file_types_ (None, None, ["aim", "txt", "lut", "arriden"])this is one line, so the open paren follows
the last underscore: ... types_(None, ...
file_path will end up with as many files
as you select, so you may end up with more
than one after the return!
Posted by chris on Mar 13, 2008
Oops, i forgot this:
from AppKit import *
Posted by Tom De Smedt on Mar 13, 2008
include("util/comment.php"); ?>
Hi Chris, I've generalized your script a bit further:
from AppKit import NSOpenPanel, NSOKButton def select_file(title="Open", types=[]): filebrowser = NSOpenPanel.openPanel() filebrowser.setTitle_(title) result = filebrowser.runModalForDirectory_file_types_(None, None, types) if (result == NSOKButton): return filebrowser.filenames() print select_file("Select Aim File", ["aim", "txt", "lut", "foo"])
file dialog box
Posted by chris on Mar 07, 2008i asked a little bit ago if there was a way to
hope this is useful for everyoneget a nice apple-ish dialog box to choose files
for input; Tom pointed me in the right direction
(Thanks, Tom!) - and here's my code snippet: