AS_ChooseFolder ( _resultTOGlobalCellName ; _prompt ; _defaultLocation )
MAC ONLY. Generates applescript to choose folder & returns result
Average rating: 4.5 (35 votes) Log in to vote
Perform Applescript ( AS_ChooseFolder("" ; "" ; "Macintosh HD/Users/Shared/") )
Alternatively, if no cell name provided, the clipboard will be set to the result. So a simple paste will allow access to data.
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
_resultTOGlobalCellName must be the full reference (i.e. including TO) for a global field. [Thanks to Bruce Roberston for tip to use global fields, it's much better: doesn't have to be on layout as other fields do.]
Uses Applescript Choose Folder dialog to allow this functionality in FileMaker.
29 Sept 2011: updated to include prompt string and default location.
24 April 2012: updated to fix filepath result (cf update to AS_ChooseFile
Feb 25, 2012
|thanks a a lot! it works great|
Jan 25, 2013
|Works well... until the user cancels the action in the finder dialogue box. Needs some extras to account for a cancel.|
Dominique, Ottawa, Canada
Apr 8, 2014
Great function!!! I love when I have client that are Mac only and I can use AppleScript!
To trap for user pressing cancel. Add the ScriptStep "Set Error Capture(On)" before running the applescript than if the return path is empty , stop everything because the user cancel.
If you don't add the Set error capture(On) FileMaker will return 2 msgbox.
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.