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.

new folder created with each new record

Featured Replies

Hi. I don't know any applescript but I would be extremely grateful if you could help me.

I have a database called Users.fp5 with a field called "UserID".

Do you know how to create an applescript which can automatically

create a new folder everytime a new record is created in the Users.fp5?

And each new folder is named the "UserID" of that particular new record.

Thank you for your time.

I tried to reply to your earlier post a couple of days ago, and somehow the entire topic vanished. Sorry about that.

You'll have to control the creation of records by means of a button which executes a script so that you can run an applescript when the new record is created. The following example shows how to create a folder and, rename and move files. Specifically, it creates a new folder inside the images folder. The new folder name is taken from the field gFolderName in the current filemaker file. It then takes a file called ExportFile in the FMDefaultExport folder renames it to the name taken from field gFileName, and then moves it to the newly created folder. This is useful for files exported from filemaker whose export name and location you normally have no control over when scripting. You should be able to adapt this for your purposes.

code:


tell app "FileMaker Pro"

set NewName to cell "gFileName"

set FolderName to cell "gFolderName"

end tell

tell application "Finder"

make new folder at folder "MacHD:images" with properties {name:FolderName}

set name of item "ExportFile" of folder "MacHD:FMDefaultExport" to NewName

move item NewName of folder "MacHD:FMDefaultExport" to folder ("MacHD:images:" & FolderName)

end tell


  • Author

Thanks Bob... I'll try and figure this out.

Cheers for your help.

  • Author

Hello.... I figured out how to create all those applescripts that I needed so that I could create folders.... thanks.

I don't know if anyone knows about using scripts via the web and CDML.... Well, I have an online form which creates a new record in the Users.fp5 database and this form also includes the "-script" tag:

<input type=hidden name=-Script value=UserIDFolder>

The script does work when I submit my online form (to create a new user record) but only if my Users.fp5 database is at the front of FileMaker when I press the submit (-new) button.

If another database happens to be at the front of FileMaker when I press the submit (-new) button then the script is ignored even though the Users.fp5 database comes to the front to create the new record.

How do I get my script to work even if another database happens to be at the front of FM Pro when I press the submit button?

.....thanks for all your help!

Change the line:

tell app "FileMaker Pro"

to:

tell database "Users.fp5" of app "FileMaker Pro"

  • 2 weeks later...
  • Author

thank you... I am now able to create a directory for each user.... cheers!

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.