I have an AppleScript .scpt file that uses the Dialog Toolkit scripting library:
Dialog Toolkit is an ASObjC-based script library for showing enhanced dialogs.
The following line is at the top of the .scpt file:
use script "Dialog Toolkit" version "2.0"
The Dialog Toolkit file is in the correct location:
/Users/Me/Library/Script Libraries/Dialog Toolkit.scptd
However, when I try to save my .scpt file in Script Editor.app, I am given the following message:
The dialog reads:
The document “Untitled.scpt” could not be saved. C and Objective-C pointers cannot be saved in scripts.
Compiling the script will reset property values and may resolve this issue.
I don't know the meaning of "C and Objective-C pointers", so I don't understand the problem.
I can successfully run and compile the script. But, after I compile the script, I still cannot save the file; I still get the above error message.
If I copy the full code and paste it into a New Document in Script Editor, the error still persists.
If I remove all of the Dialog Toolkit code from my script, then I can save the .scpt file, without error. Hence, it seems that the issue has something to do with how Script Editor handles an external script library.
Also, I have noticed general "bugginess" when working on my script that contains Dialog Toolkit code in Script Editor.
For example, sometimes Script Editor.app will spontaneously quit if the document is open.
Other times, when I press the "Compile the Script" or "Run the Script" button, my cursor transforms into the spinning pinwheel, and remains as a pinwheel for over a minute. Script Editor freezes up, so I then have to Force Quit Script Editor.
There is some chance that this question is related to a previous question of mine:
Everything that is listed in the "What I've tried:" section of the above question also failed to fix the The document could not be saved. error.
OS X El Capitan, version 10.11.6.
Script Editor Version 2.8.1 (183.1)