AppleScript Apps written in 10.10 fail in 10.6

Hi fellow scripters, I hope you can help.

I am writing Applescript applications and have had reports from some users that the apps which have been working properly have become completely unresponsive or launch and immediately quit when trying to launch in OS X 10.6 (and maybe 10.7?)

These apps and users were running as expected until recently and I’m pretty sure the change for the worse has coincided with my move to 10.10. I think the cause is that the apps are now being compiled in Script Editor in Yosemite (Currently on 10.10.2).

It’s hard for me to test back to 10.6 so if anyone has any info, reason, explanation or even a fix?? I would really appreciate it!

Thanks
Ken

It’s a known bug – script applets saved under Yosemite won’t run under 10.7 or earlier. The workarounds are to save them from an earlier version of the OS, or keep an old version of the applets around, and just replace the main.scpt file inside the application bundles.

Thanks a lot for your reply Shane.

At least I now have a workaround by using an older Mac to build although that is gonna be LOTS of work!

Replacing the main.scpt file inside the application bundles would be easier but would that cause a problem with Code Signing?

I can’t find a mention of this bug online so if you know of one please post here and also if anyone knows of a fix to this bug being released then please do post a reply to this thread.

Yes it will. If you need to sign your code, you need to do it under 10.9 or 10.10 to be recognised by the latest version of GateKeeper. So that really means saving from Mavericks.

It was discussed a while back on Apple’s AppleScript users mailing list.

Hi again. Can you give a little more info about the workaround to swap main.scpt file inside the application bundles, please?

My trouble is that my Apps are usually made up of lots (e.g. 50+) smaller applets.
I can forgo the code signing of these smaller apps as I still code sign their parent app in Xcode at the end.

What exactly is the purpose of the main.scpt file, if I edit the applet script in 10.10 can I still swap the main.scpt from an earlier version of the applet script or does the main.scpt need to relate to the latest version of the content? Or is it in fact an encrypted version of the script itself as the name suggests?!

In this case there is currently no way to work in 10.10 and release updates any of the applets to 10.6 without first recompiling and exporting in 10.9…

Thanks for your time, just want to understand all the options before attempting to roll back to 10.9 or getting another Mac purely for compiling :frowning:

If you’re doing the signing in Xcode after swapping main.scpt, you’ll quite possibly be fine.

That’s the actual AppleScript code. An applet is just code that loads and runs main.scpt.

It’s the stuff other than main.scpt that is version-dependent. You have two ways of going about it:

  • Make a copy of the app, edit it, then copy it’s main.scpt to replace the original; or

  • Edit the main.scpt file directly. Use control-click to select Show Package Contents, navigate to /Contents/Resources/Scripts/main.scpt, and open it directly.

Another partition or disk might be a less drastic option.