With this issue if I start with a compiled script, that includes a scripting addition call, then add a “use script” command along with a “use scripting additions” command I get a hang that doesn’t end and I have to force quit.
Start with this script and compile and run it:
set junkMailInfo to {} -- in the actual script this is a 300+ lists with three items each but it hangs with an empty list
set dataFileLocation to path to application support from user domain
add this at the top:
use script "filemanagerlib"
use scripting additions
Compile the result. Hang.
This seems so simple it’s hard to believe I haven’t come across it before.
After the force quit the Apple bug reporter appeared:
I don’t know if this is related or not, but this is the second time this has happened. I work on the same script at home and at work, keep the most recent version on DropBox.
At work I open the script which contains this line:
use script "FileManagerLib" version "2.2.1"
The first time this happened a few days ago, I was surprised because I thought I had the most recent version on both systems. I didn’t investigate further and simply redownloaded and reinstalled FileManagerLib.
Well, it’s happening now.
Compile Error: Can’t get script “FileManagerLib” whose version ≥ “2.2.1”.
I’ve verified that version 2.2.1 is installed (using finder’s get info and I actually opened the script (aren’t Shane’s libraries usually run-only?). *
So the first time it happened I was in a bit of a rush and I removed the version and went on with my scripting and redownloaded and reinstalled a little later.
It may have been after that I was getting this hanging but where I had to force quit.
(also, I had a glitch using Open quickly. I did a search for “FileManagerLib” and it showed the one in user script libraries folder. I clicked the Info button and it showed the preview version of the script I had open. Closed that and clicked info again and it showed the preview version of “FileManagerLib”
That’s all AppleScript’s doing. FWIW, I’ve thought I’ve caught it out a couple of times, but it’s always ended up being me. (Forgetting to dirty the script and recompile after adding a new version catches me regularly; libraries get cached.)
No. A couple are where they involve an embedded custom framework, but where possible I distribute them fully editable. I just ask that if people modify them, they use a different name.
Objective-C frameworks have a structure that requires the use of links, and they can pose problems for Dropbox. Short version: be careful when updating any libraries that contain embedded frameworks in folders under Dropbox control. It’s safer to remove the old version everywhere, before adding the new one.