May 12, 201510 yr Hi, I'm a pure newbie to Mac (Mac OS X 10.8.3) and trying to a folder based on field data under a fixed path, but without any luck: set dirName to cell "fk_person_id" of current record set targetPath to quoted form of ("/Volumes/Macintosh/cluster5/medistic/media/" & dirName) do shell script "mkdir -p " & targetPath The above returns the below errors:Object not found.Unknown error: -1728. What is wrong with my script, please help...
May 12, 201510 yr Do you want to perform this from within FileMaker? If so, you can use a direct field reference: List ( "set dirName to " & YourTable::fk_person_id ; // note that this now is a FileMaker field reference "set targetPath to quoted form of ( \"/Volumes/Macintosh/cluster5/medistic/media/\" & dirName )" ; "do shell script \"mkdir -p\" & targetPath") Test the result of that expression (not this Filemaker code) in the (Apple)Script Editor. Edited May 12, 201510 yr by eos
May 12, 201510 yr Author set dirName to "person_pk2fk_media::fk_person_id" set targetPath to quoted form of ("/Users/cluster5/medistic/media/" & dirNAme do shell script "mkdir -p " & targetPath returns a folder as below (rather than the fk_person_id which should be 10001) : person_pk2fk_media//fk_person_id Any advice how to fix ? Edited May 12, 201510 yr by mastichis
May 12, 201510 yr Author Well, if I'm correct I'm trying to run this in a Native AppleScript -to create a new directory. I dont even know if this is the correct approach as I'm not even a Mac user, I'm a Windows user, and all this doesn't really make sense to me. The folder "person_pk2fk_media//fk_person_id" is created when script is run. What should I change to create the correct folder name taken from the field "person_pk2fk_media::fk_person_id" ?
May 12, 201510 yr Well, if I'm correct I'm trying to run this in a Native AppleScript This is a Filemaker calculation; you need to specify the code as the calculation for the “Calculated AppleScript” option. As noted before: try to evaluate this in the Data Viewer (in the correct context, i.e. person_pk2fk_media) and test the result in the AppleScript Editor.
May 12, 201510 yr As an aside: set dirName to cell "fk_person_id" of current record requires that the field "fk_person_id" be present on the current layout - otherwise you will get the error mentioned in the original post.
May 13, 201510 yr Author Ok, that made some sense -didn't pick it up at first. I got it working, putting it in the "Calculated AppleScript" as you said EOS and it worked! Final working code: List( "set dirName to " & person_pk2fk_media::fk_person_id ; "set targetPath to quoted form of (\"/Users/cluster5/medistic/media/\" & dirName)" ; "do shell script \"mkdir -p \" & targetPath" ) Result: /Users/cluster5/medistic/media/10001 Thank you all for helping out!
May 13, 201510 yr You could also use Base Elements Plugin to create folders at a path plus it will work on mac and windows http://www.goya.com.au/baseelements/plugin
Create an account or sign in to comment