applescript

I have written an Applescript package including a library. If I load the library at run time (via the "load script" command) it works. If I try to load the same library at compile time, the Script editor fails with a "cannot save the script" message. Whilst I think this is a problem of size, I can find no explanation of a limit to the size of a script. If the script + library exceeds about 900kb, this error always seems to occur. It is somewhat limiting when trying to write a decent sized package. Is there any way around this problem?

Posted on Sep 7, 2020 6:22 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 8, 2020 12:13 PM

Are you using Apple's Script Editor for your script?


I don't know if it still holds true, but about a hundred years ago when I started writing AppleScripts, Script Editor had a hard limit on 32k scripts (go figure).

I got around it at the time by using libraries, like you, and that carried me for a while. And even though I have to believe that limit has been raised in the intervening years (decades? omg!), I discovered Script Debugger and haven't looked back since. Besides completely blowing away Script Editor's size limits, it adds inspectors, debugging, tracing, breakpoints and a whole lot more. A free trial is available from their site. Might be worth trying to see if it overcomes the limits you're encountering.

2 replies
Question marked as Top-ranking reply

Sep 8, 2020 12:13 PM in response to macglh

Are you using Apple's Script Editor for your script?


I don't know if it still holds true, but about a hundred years ago when I started writing AppleScripts, Script Editor had a hard limit on 32k scripts (go figure).

I got around it at the time by using libraries, like you, and that carried me for a while. And even though I have to believe that limit has been raised in the intervening years (decades? omg!), I discovered Script Debugger and haven't looked back since. Besides completely blowing away Script Editor's size limits, it adds inspectors, debugging, tracing, breakpoints and a whole lot more. A free trial is available from their site. Might be worth trying to see if it overcomes the limits you're encountering.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.