Brian Dunning's FileMaker Custom Functions

AS_Folder_List ( FolderPath ; invisibles ; global_result_field )

list the content of a specific folder and returns the result to a FileMaker global text field. (Mac OS X only, AppleScript)

  Average rating: 4.5 (17 votes) Log in to vote

Thomas Siebert   Thomas Siebert - Show more from this author
http://www.t-seabird.de

Share on Facebook Share on Twitter

  Sample input:
Perform AppleScript [ AS_Folder_List ( Get ( DocumentsPath ) ; 0 ; table::text_field ) ]
  Sample output:
all filenames inside the folder returning as list to a global field

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

list the content of a specific folder by returning it into a FileMaker text field

FolderPath = the path for the folder to list its content
invisibles = list also invisible items
result_field = the FileMaker field to return the result ( table::field ) using the current record.

Use the ScriptStep "Perform AppleScript" using the option "Calculated AppleScript"
You also shall use "Perform AppleScript" directly from a button.

Die CF wird über den Scriptschritt "AppleScript ausführen" mit der Option "Berechnetes Script" genutzt.
"AppleScript ausführen" steht auch direkt in den Tastenkommandos zur Verfügung.

 

Comments

Thomas Siebert   Thomas Siebert
Dec 14, 2016
the CF now accepts either:
table::field
or
"table::field"

to deliver the field for the result returned.
 
Thomas Siebert   Thomas Siebert
Jan 19, 2017
error message appears if no record is present or if path is not valid
 
Thomas Siebert   Thomas Siebert
Apr 22, 2017
now the result field has to be a global textfield of any table.
 
Thomas Siebert   Thomas Siebert
Apr 22, 2017
the function has been renamed
 
Jon Jeffery   Jon Jeffery, Linear Blue
Jun 27, 2019
Note, in FM17 and later you have to have the fmextscriptaccess extended privilege checked, to allow AppleScript to write back to FileMaker
 
Robert   Robert, Luxembourg Europe
Jun 6, 2020
Is it possible to have the result in a variable?
 
Thomas Siebert   Thomas Siebert
Jun 7, 2020
you can take the result from the global field and copy it to a variable.
AppleScript in FileMaker has no command or function to set a variable.
It is possible to use the AppleScript command from the mbs plugin but if you use the plugin you have also the file and folder functions of the plugin.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: