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.

Applescript in Filemaker

Featured Replies

I am a newbie to all of this and little idea of what I am doing.

I am trying to create an Applescript in FM that will create a new folder and name that folder by the JobNum field (it is a serial number to identify that record).

Here is the script that I currently have:

tell application "Finder"

activate

make new folder at folder "Current Jobs" of startup disk with properties {name: JobNum}

end tell

The error message that I get when I use this script is:

"The variable JobNum is not defined."

I am having a hard time figuring out what this means and how I can get this script to work. Any help is much appreciated!

  • Author

I am a newbie to all of this and little idea of what I am doing.

I am trying to create an Applescript in FM that will create a new folder and name that folder by the JobNum field (it is a serial number to identify that record).

Here is the script that I currently have:

tell application "Finder"

activate

make new folder at folder "Current Jobs" of startup disk with properties {name: JobNum}

end tell

The error message that I get when I use this script is:

"The variable JobNum is not defined."

I am having a hard time figuring out what this means and how I can get this script to work. Any help is much appreciated!

  • Author

I am a newbie to all of this and little idea of what I am doing.

I am trying to create an Applescript in FM that will create a new folder and name that folder by the JobNum field (it is a serial number to identify that record).

Here is the script that I currently have:

tell application "Finder"

activate

make new folder at folder "Current Jobs" of startup disk with properties {name: JobNum}

end tell

The error message that I get when I use this script is:

"The variable JobNum is not defined."

I am having a hard time figuring out what this means and how I can get this script to work. Any help is much appreciated!

It means what it says. If that's the whole script you haven't told it what value JobNum is, and it is reminding you of the fact. As it is JobNum is just an AppleScript variable which has never been set to anything at all, so it's an error.

If this is inside a FileMaker Perform AppleScript step*, it should have something like:

set JobNum to cell "JobNum" of current record

then the rest of the script.

The field JobNum would have to on the current layout for the above to work. Or you can specify the layout:

set JobNum to cell "JobNum" of current record of layout "Job"

There are alternative places to the startup disk, which is the top level, not usually a place where I'd put user documents.

You could use:

make new folder at desktop with properties {name: JobNum}

Which would be the user's desktop. Or

make new folder at (path to documents folder) with properties {name:JobNum}

User's Documents folder

*If this is NOT inside a FileMaker Perform AppleScript step, but is being written or run in Script Editor (perhaps for testing), then it needs a FileMaker tell block:

tell application "FileMaker Pro"

rest of script

end tell

It means what it says. If that's the whole script you haven't told it what value JobNum is, and it is reminding you of the fact. As it is JobNum is just an AppleScript variable which has never been set to anything at all, so it's an error.

If this is inside a FileMaker Perform AppleScript step*, it should have something like:

set JobNum to cell "JobNum" of current record

then the rest of the script.

The field JobNum would have to on the current layout for the above to work. Or you can specify the layout:

set JobNum to cell "JobNum" of current record of layout "Job"

There are alternative places to the startup disk, which is the top level, not usually a place where I'd put user documents.

You could use:

make new folder at desktop with properties {name: JobNum}

Which would be the user's desktop. Or

make new folder at (path to documents folder) with properties {name:JobNum}

User's Documents folder

*If this is NOT inside a FileMaker Perform AppleScript step, but is being written or run in Script Editor (perhaps for testing), then it needs a FileMaker tell block:

tell application "FileMaker Pro"

rest of script

end tell

It means what it says. If that's the whole script you haven't told it what value JobNum is, and it is reminding you of the fact. As it is JobNum is just an AppleScript variable which has never been set to anything at all, so it's an error.

If this is inside a FileMaker Perform AppleScript step*, it should have something like:

set JobNum to cell "JobNum" of current record

then the rest of the script.

The field JobNum would have to on the current layout for the above to work. Or you can specify the layout:

set JobNum to cell "JobNum" of current record of layout "Job"

There are alternative places to the startup disk, which is the top level, not usually a place where I'd put user documents.

You could use:

make new folder at desktop with properties {name: JobNum}

Which would be the user's desktop. Or

make new folder at (path to documents folder) with properties {name:JobNum}

User's Documents folder

*If this is NOT inside a FileMaker Perform AppleScript step, but is being written or run in Script Editor (perhaps for testing), then it needs a FileMaker tell block:

tell application "FileMaker Pro"

rest of script

end tell

  • Author

Thank you so much! This is going to make our workflow so much easier and I am really jazzed about learning more about Applescript.

Thanks!

  • Author

Thank you so much! This is going to make our workflow so much easier and I am really jazzed about learning more about Applescript.

Thanks!

  • Author

Thank you so much! This is going to make our workflow so much easier and I am really jazzed about learning more about Applescript.

Thanks!

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.