Page 1 of 1

Error with Xtend help project in SC 4.8 beta 21

PostPosted: Wed Aug 24, 2016 5:56 am
by HairyHighlandCow
When I try to install an external from Xtend into another SC project, using the 'Install into ---> Other Project…' menu icon in the toolbar, I'm seeing 'Error 15: Expected a boolean but found something else' with 'Quit' and 'Cancel' options.

Re: Error with Xtend help project in SC 4.8 beta 21

PostPosted: Wed Aug 24, 2016 6:23 am
by Scott

Re: Error with Xtend help project in SC 4.8 beta 21

PostPosted: Wed Aug 24, 2016 11:41 am
by HairyHighlandCow
Thanks Scott, I must have missed that post. All fixed now.

Re: Error with Xtend help project in SC 4.8 beta 21

PostPosted: Wed Sep 14, 2016 4:19 am
by HairyHighlandCow
Hi,
Beta 22 has a new error with installing externals into a project via the toolbar menu in Xtend... it is now showing 'File not Found'
Thanks
Alec

Re: Error with Xtend help project in SC 4.8 beta 21

PostPosted: Wed Sep 14, 2016 7:31 am
by Scott
Hmmm... I'm not seeing this here. What external are you installing, and what is the path of the project you're trying to install to?

Re: Error with Xtend help project in SC 4.8 beta 21

PostPosted: Thu Sep 15, 2016 1:30 am
by HairyHighlandCow
Hi Scott,
The Xtend project had been accidentally moved out of the Help Projects folder, once back inside it installs externals correctly again.
One quick question, I think at some point it was possible for Xtend to install an external into a project currently open in SuperCard, but now the project has to be closed or Xtend will report error 9980. Would it be possible to allow Xtend to install an external into an open project?
Thanks
Alec

Re: Error with Xtend help project in SC 4.8 beta 21

PostPosted: Thu Sep 15, 2016 8:53 am
by codegreen
Would it be possible to allow Xtend to install an external into an open project?

Okay here's the problem...

The copy is failing because the relevant script is not detecting that the target project is open due to a problem in the updated fileBusy() XFcn.

The old version of fileBusy() worked only on classic MacRoman 31-character file names. About seven years ago I updated it and a bunch of other externals to support long file names. At the same time I changed how this external works. Originally it only reported whether the data fork was open, and determined this by the old primitive and expensive method of actually trying to open it.

Carbon includes a more modern API for testing whether one or more forks of a file are open which supports long file names. You create an FSRef to the file, then use that to ask for its catalog info. The returned structure has separate flags that are supposed to indicate whether the data fork and resource fork (if any) are open. The newer fileBusy reports the value of these flags back to the scripter.

Unfortunately it seems that despite being amply documented and widely recommended, and unbeknownst to me and apparently everyone on the Carbon mailing list, this API does not actually work! No matter how or under what conditions you request them, the relevant flags of the catalog info structure are never actually set...

For some reason though Scott never updated Xtend to use the new fileBusy() internally until the last beta, so this issue was never detected.

I'll put together another update to fileBusy that supports long filenames but goes back to the old method of trying to open the file's forks with write permission. This has its own issues of course (e.g., it won't work on files you don't have permission to open) but I can't really think of another option...

Thanks,
-Mark

Re: Error with Xtend help project in SC 4.8 beta 21

PostPosted: Thu Sep 15, 2016 10:05 am
by codegreen
I just posted an update to fileBusy that should fix this:

http://forums.supercard.us/viewtopic.php?f=16&t=2368

Please let me know if it works at your end too...

Thanks,
-Mark