Really need help - AppleScript no longer works [needed update for sandboxing]

Hi, can anyone help me diagnose the problem with the following script?

tell application “FileMaker Pro”
tell database “ACCOUNTS”
tell table “Omnifocus”
tell record 1
set mytasktitle to cell “mytasktitle” of record 1
set mytasknotes to cell “mytasknotes” of record 1
set MyFile to cell “MyFile” of record 1
set MyContext to cell “MyContext” of record 1
end tell
end tell
end tell
end tell

tell application “OmniFocus”
tell the front document
set theTask to make new inbox task with properties {name:mytasktitle, note:mytasknotes}
tell the note of theTask
make new file attachment with properties {file name:MyFile, embedded:true}
end tell
end tell
end tell

Basically, I have FileMaker Pro export a file and its attached into Omnifocus - this used to work without any problem under OF 1.0, but only the text is passed under OF 2.0 ---- I desperately need the files to be attached (embedded) into the Omnifocus document

If anyone can help I would greatly appreciate it…

Many thanks

I think this is the problematic line:

make new file attachment with properties {file name:MyFile, embedded:true}

In the new sandboxed world, you need to let AppleScript know that you want to pass that variable as a file rather than a string, so it can grant access to the app you’re scripting:

make new file attachment with properties {file name:POSIX file MyFile, embedded:true}

Hope this helps!

Thanks Ken…you’re a star!!!