Sunday, February 23, 2020

#1 2020-02-07 01:28:40 pm

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 483

I can't save my main script library as .scpt

My main library script (not posting script as it's rather large, currently 7,270 lines) stopped saving as a .scpt or .scptd. (or .app) It compiles fine, it saves fine as a .applescript.

I copied and pasted all the code into a new document. Then trying to save from Script Debugger as .scptd, I get the error:

Cannot Save Document
Invalid Component Instance
(badComponentInstance:-32767



Trying the same thing from Script Editor, I get:

"The document "Untitled" could not be saved as "Additions.scptd". (Error -2,707)



Trying to save it as .scpt from Script Debugger, I got the exact same thing, except the error number at the end is -2147450879.

I'm trying to review to see what has been changed since the last time it did save successfully.

In the meantime, any ideas here about what could cause something like this?

Last edited by t.spoon (2020-02-07 01:29:40 pm)


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

#2 2020-02-07 02:21:11 pm

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3951

Re: I can't save my main script library as .scpt

I faced such behavior some years ago and its was a problem of size of the package.
May you try to split your library into two packages ?

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 7 février 2020  21:20:59

Offline

 

#3 2020-02-07 02:40:10 pm

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 483

Re: I can't save my main script library as .scpt

That occured to me, but our biggest script is 512 KB and 9051 lines, this one's 7,270 lines and only 323 KB. But maybe the limit here isn't based on lines or KB, but some limit on the number of certain types of commands or something.

I chopped it around the middle and made it two scripts, and each saved successfully.

So either you're correct that it's simply gotten too big, or else the problem is something that involves a combination of elements, not a single line or command or something.

We've been meaning to divide up the library anyway because it's too big, it's just that that's a PITA project, changing all the references to the commands we pull out into another library.

Thanks Yvan,

t.spoon

Last edited by t.spoon (2020-02-07 07:50:38 pm)


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

#4 2020-02-07 02:52:59 pm

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3951

Re: I can't save my main script library as .scpt

Of course, the count of lines isn't the unique parameter.
The length of lines matters too as well as the number of characters.

Recently Shane Stanley urged me to make a deep cleaning upon a library which is only 1454 lines long and a total of 55830 characters.
Given its experience with such tools, I will do the job as soon as I can.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 7 février 2020  21:48:53

Offline

 

#5 2020-02-07 04:51:10 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6192

Re: I can't save my main script library as .scpt

t.spoon wrote:

But maybe the limit here isn't based on lines or KB, but some limit on the number of certain types of commands or something.



It certainly isn't based on lines or KB -- although lines can be used as a very rough metric.

You might find the discussion here useful:

https://forum.latenightsw.com/t/comment … vs/2211/10


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#6 2020-02-07 07:49:29 pm

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 483

Re: I can't save my main script library as .scpt

Thanks, Shane. That's an interesting thread.

We'll have to pare it down, move functions to other libraries.

Ugh. I can't decide if it's worth the headache to write a script that will find and change all the references in all the other scripts, or just do a search and go through them all by hand. For each function we move.

Last edited by t.spoon (2020-02-07 07:49:53 pm)


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)