Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Want FM8 to run Applescript to create folder with record data as folder name


This topic is 6677 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

This topic is 6677 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.