1

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)

1 Answer 1

1

First thing I would try is opening up the scripteditor.app library panel. In Scripteditor go to menu item "Window/Library"

enter image description here

If dialog toolkit is present in the list, I would select it in the list and remove it. Then I would quit scripteditor.app and relaunch it again. Once scripteditor.app is up and running again, Open the Library panel and click on the “Add” button in the menu bar and navigate to ~/Library/Script Libraries and select Dialog Toolkit.scptd.

That will probably solve your problem. I have a funny feeling the problem is occurring because your new com.apple.ScriptEditor2.plist file probably does not contain any reference to the Dialog Toolkit.scptd as per this example in this image..

This is com.apple.ScriptEditor2.plist file opened in xcode

enter image description here

5
  • Can you please explain how to "open up the scripteditor.app library panel"? I don't understand how you arrived at the screenshot. May 28, 2017 at 6:55
  • 1
    Dialog Toolkit was not present in the Script Editor "Library" list, so I added it. I then relaunched Script Editor. But, when I went to save the .scpt file that contains Dialog Toolkit code, I still received the same error that I described in my post. I then opened my com.apple.ScriptEditor2.plist file in Xcode, and saw that it does contain the Dialog Toolkit library. However, I then deleted the Dialog Toolkit library in the Script Editor menu, and I immediately re-added it. I then compiled the script, and realized that now I can save the .scpt file without error. Thanks! May 28, 2017 at 7:26
  • That's how we learn LOL it's all about trial and error
    – wch1zpink
    May 28, 2017 at 7:30
  • Yes. I will say, though, that this whole experience w/ Script Editor has had the effect of making Script Debugger.app look more attractive... May 28, 2017 at 7:35
  • Ever since your YouTube Play/Pause post, I have turned my focus away from script debugger to struggling with Xcode lol
    – wch1zpink
    May 28, 2017 at 7:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .