January 26, 20178 yr I had a previous solution in Windows using Sendevent to select a folder, then create a text file of it's contents, then import that list into a field, one tabbed item per record. "cmd /c cd " & $importdir & "&&" & "dir /b > filelist.txt" Moving to a OS X, I'm trying to use the excellent BaseElement plugin. I've used BE_ListFilesInFolder to get the list of files in a folder and have it dropped into a text field. The output is tabbed, one item per line. I can't figure out how to create a script to get the contents of that field, and populate each line into a field, one per record. Any ideas?
January 26, 20178 yr 2 hours ago, jarmen said: The output is tabbed, one item per line. I am not sure what you mean by "tabbed". I believe the output is a return-separated list. To create a record for each item in the list, make your script do: Set Variable [ $files; Value:BE_ListFilesInFolder ( "/Users/YourUserName/Documents/SomeFolder" ) ] Go to Layout [ “Files” ] Loop Set Variable [ $i; Value:$i + 1 ] Exit Loop If [ $i > ValueCount ( $files ) ] New Record/Request Set Field [ Files::Fielname; GetValue ( $files ; $i ) ] End Loop Commit Records/Requests where "Files" is the table you want to use in order to store these records.
Create an account or sign in to comment