View Single Post
Sorry, this is a sandboxing issue. I wish we could continue to execute your old scripts without warning, but Apple has decided that letting us write file output to an arbitrary location endangers you, the user. Once we are handling an Apple event there is really know way for the system to be sure that you, the user, had any part in authorizing that event. It's all a bit baffling, but somehow if you face east and wave your hands in the air, it suddenly becomes ok to use POSIX files in the exact same way, for example:

tell application "OmniPlan"
tell front document
export to POSIX file "/tmp/foo.pdf" as "PDF"
end tell
end tell

I'm honestly quite clumsy with AppleScript and gave up after 60 seconds of trying to refactor your exporttoPdf() function, but speak up if you have trouble getting POSIX file to work.