August 11, 200619 yr Greetings, I am trying to run an Applescript from within FM8 to create a folder on our server "automatically" with the name of the applicant so that we can add related documents to it. The folder gets created, but I can't figure out the syntax for making FM feed in the applicant data for the folder name. Can anyone give me a hand? Applescript: ------------------------ tell application "Finder" activate select Finder window 1 select Finder window 1 set target of Finder window 1 to disk "Groups" select Finder window 1 select Finder window 1 set target of Finder window 1 to folder "Applicant Group" of disk "Groups" clean up Finder window 1 by kind select Finder window 1 select Finder window 1 set target of Finder window 1 to folder "2007 Admissions" of folder "Applicant Group" of disk "Groups" clean up Finder window 1 by kind select Finder window 1 select Finder window 1 set target of Finder window 1 to folder "2007 Applicant Correspondence" of folder "2007 Admissions" of folder "Applicant Group" of disk "Groups" select Finder window 1 make new folder at folder "2007 Applicant Correspondence" of folder "2007 Admissions" of folder "Applicant Group" of disk "Groups" with properties {name:"LASTNAME, FIRSTNAME APPLICANT"} end tell ------------------------ Just above here is the hardcoded name of the folder, what I need is how to get: Applicant::LastName &", " Applicant::FirstName & Applicant::ApplicantNum ...into there correctly. Any help with this syntax? Thanks in advance.
August 11, 200619 yr That looks suspiciously like a recorded AppleScript. Which is OK, but it is (way) longer than it needs to be. (Like running "clean up" every time.) Also, AppleScript natively does not have a great way of handling this. OS X command line, mkdir, is more direct, as it can create the intermediate folders with one step. This does much the same thing (the: tell app "FileMaker" lines are not needed inside a FileMaker Perform AppleScript step, so I commented them out; needed to view in Script Editor however). The LastName and FirstName fields must be on the current layout with this simple syntax. --tell application "FileMaker Pro Advanced" set LastName to cell "LastName" of current record set FirstName to cell "FirstName" of current record --end tell set thePath to quoted form of ("/Volumes/Groups/Applicant Group/2007 Admissions/2007 Applicant Correspondence/" & LastName & ", " & FirstName) do shell script "mkdir -p " & thePath
Create an account or sign in to comment