Until recently, we were using Satimage OSAX and a feature called navchoose which allowed a user to select both files and folders from a single dialog box. The equivalent in Applescript is the choose file or choose folder commands, but you can’t do both in one dialog. This Satimage command only worked in 32-bit (I think Shane explained this to me a long time ago as to why this was). Anyway, the calling application was Filemaker Pro 13 (which ran 32-bit), but now we’ve upgraded to Filemaker Pro 15 which is 64-bit and the navchoose command called from Satimage now fails from within Filemaker’s Perform Applescript function.
I googled for a method to choose both files and folders and found this code snippet, but this doesn’t work at all. It immediately errors with: NSOpenPanel doesn’t understand the “openPanel” message.
Is there some way to tweak this to get this to work? I’m a newbie when it comes to ASObj-C stuff, so any info would be appreciated.
set defaultDirectory to POSIX path of (path to desktop) -- a place to start tell current application's NSOpenPanel's openPanel() setFloatingPanel_(true) setTitle_("Choose some stuff:") setPrompt_("Choose") -- the button name setDirectoryURL_(current application's nsurl's URLWithString:defaultDirectory) setCanChooseFiles_(true) setCanChooseDirectories_(true) setShowsHiddenFiles_(false) setTreatsFilePackagesAsDirectories_(false) setAllowsMultipleSelection_(true) set theResult to its runModal() -- Grammar Police as integer -- show the panel if theResult is current application's NSFileHandlingPanelCancelButton then quit -- cancel button set theFiles to URLs() as list end tell repeat with X from 1 to (count theFiles) -- coerce the file paths in place set (item X of theFiles) to (item X of theFiles)'s |path|() as text -- as POSIX file end repeat choose from list theFiles