Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.