Jump to content

External script containing email Applescript


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

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7201 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
 Share

×
×
  • Create New...

Important Information

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