Skip 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.

External script containing email Applescript

Featured Replies

Hi all,

I have an email button in my contacts file that opens Outlook with an applescript and enters contact information in the email:

tell application "FileMaker Pro"

set strURL to cell "email" of current record

set strFNAME to cell "First" of current record

set strLNAME to cell "Last" of current record

set strMAILTO to {strFNAME & " " & strLNAME & "<" & strURL & ">"}

end tell

tell application "Outlook Express"

activate

set theMSG to make new draft window with properties {to recipients:strMAILTO}

end tell

It also enters a date and some other information in a log in the same file. This all works fine.

We also have a related Company file with a portal to the contact file that lists all the individual contacts. Today I tried to place a button in the (Contacts) portal row of the Company file that would run the email script as an external script but I keep getting the "Object not found, Error -1728" message.

Here is that script:

Go to related Record [Match company to CONTACT file]

Perform Script [Filename: "Contactcs.fp5" (*), "Send Email"]

Go to Layout [Original Layout]

The other steps in the script worked fine (the ones that enter the information in the log).

As a test, I tried linking the new email button in the Company file to other scripts in the contact file and they worked OK. It just won't do the email thing.

Am I missing something (obviously!). Any help would be appreciated.

Thank you.

Deborah

In what file does the information your loading into the variables in the AppleScript exist?

The fields must be in the active (frontmost) file in the syntax you had written. If that is not the case, then ther -1728 error could be generated.

Why aren't you using the built-in Send Mail ScriptMaker step?

Old Advance Man

  • Author

Hmmmm,

Well, I'm pretty inexperienced at FileMaker and Applescript. I used the Applescript after asking for a script that would open a new Outlook Express email. I was directed (I think on the FileMaker newsgroup) to an Applescript page. I had originally hoped I could do it from FileMaker....

I thought that by having my first script step take me to the file in question (Go to related Record [Match company to CONTACT file]), this would take care of the reference issue (being the active file).

If I'm wrong about this, I hope someone can suggest a way to make this work.

Thanks.

FMP 5.5 supports numerous email clients. AppleScript probably not needed. Look at the Send Mail ScriptMAker step.

Old Advance Man

  • Author

Well, we have 5.0. Not sure when we will upgrade - not my decision...in the meantime, can anyone see any reason why my script isn't working?

Thank you.

Deborah

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.