Jump to content
Server Maintenance This Week. ×

AppleScript change in Snow Leopard?


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

Recommended Posts

Our database has a script that adds a PDF file to a record so it can be sent by email (via the mail.it plug-in).

The AppleScript is very simple:

tell application "FileMaker Pro"

	set theFilePath to cell "InvoicePDFAttachment" of current record

	set the cell "InvoicePDFAttachmentContainer" of current record to (file theFilePath)

end tell

One of our client computers was upgraded to Snow Leopard and this script now fails when it gets to the Perform AppleScript step, the error says:

FileMaker Pro got an error: Object or property is the wrong type.

If I try to edit the AppleScript in the script step on the client running Snow Leopard it errors tells me it expected an end of line, etc. but found """ and indicates the problem is the quote around the cell field name. If I remove the quotes then AppleScript complains that it expected an end of line, etc. but found identifier.

I take it there are significant AppleScript changes in 10.6, does anyone know if there are workarounds for what I am experiencing or will I have to hold off on upgrading my clients to 10.6?

Link to comment
Share on other sites

There's an Invoice ID field, let's call it "ID", then there's a calculation that derives where the file should be, let's call it "PDFpathCalc" defined as "HardDrive:PDFs:" & ID & ".pdf"

So for a given record where ID="31254"

then PDFpathCalc="HardDrive:PDFs:31254.pdf"

Now I just need to put that file into the container.

Link to comment
Share on other sites

In response to a question since deleted:

There were changes in Applescript between OS X 10.4 and OS X 10.5. I don't know of any changes in FMP 10 - certainly not documented changes.

Edited by Guest
I'm not yet crazy enough to post out of context.
Link to comment
Share on other sites

  • 3 weeks later...

Had the same problem, wasn't solved by the internal Filemaker script. For me, the line

set field "Image" of current record to file (curFilePath) as alias

worked. I had been using

"set cell "Image" of current record to file (curFilePath)

but it has to be specified as an alias, and field for cell.

Link to comment
Share on other sites

This topic is 5337 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
×
×
  • Create New...

Important Information

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