AppleScriptObjC Explored tutorial: issues using Lion & Xcode 4.1

When using the AppleScriptObjC Explored manual, to learn AppleScriptObjC using the Lion OS & Xcode 4.1, there are some issues.
I am hoping that folks will post the work arounds here (with page numbers to reference) until an update becomes available .

Page 12 starts with adding the bindings.
I’ve been able to get the basic script to compile & run for “Making Progress”, however as soon as I bind any fields or buttons, the app will loop and the app window will not launch.

Xcode will state it’s running the app but the icon just bounces in the dock until I press stop.
If I undue the binding the app will compile & run and the apps window will come up.

That sounds like incorrect bindings. Maybe a screen shot would help us diagnose more.

In case people are wondering, an Xcode 4 version of the book is coming. It’s been delayed, largely because of the amount of work involved – nearly every screenshot has to be redone, and a lot of stuff has to be rewritten heavily. In between, I have to try to make a living.

I’m thinking of issuing a preview version, to get it out more quickly. This would have the projects and section on using Xcode updated, but with the rest to be updated little. If anyone thinks this a particularly good or bad idea, let me know.

I’m not sure if this will help, however,
This is the output:

GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “x86_64-apple-darwin”.tty /dev/ttys000
[Switching to process 45116 thread 0x0]
2011-07-23 18:56:08.731 MakingProgress6[45116:407] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
MakingProgress6: OpenScripting.framework - scripting addition “/Library/ScriptingAdditions/Adobe Unit Types.osax” declares no loadable handlers.
2011-07-23 18:56:08.734 MakingProgress6[45116:407] Error loading /Library/ScriptingAdditions/XML Tools.osax/Contents/MacOS/XML Tools: dlopen(/Library/ScriptingAdditions/XML Tools.osax/Contents/MacOS/XML Tools, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/XML Tools.osax/Contents/MacOS/XML Tools: no matching architecture in universal wrapper
MakingProgress6: OpenScripting.framework - scripting addition “/Library/ScriptingAdditions/XML Tools.osax” declares no loadable handlers.
2011-07-23 18:56:08.818 MakingProgress6[45116:407] Unknown class ‘MakingProgress6AppDelegate’, using ‘NSObject’ instead. Encountered in Interface Builder file at path /Users/******/Library/Developer/Xcode/DerivedData/MakingProgress6-eoigmlmpuklfpafaxcuteklwpuum/Build/Products/Debug/MakingProgress6.app/Contents/Resources/en.lproj/MainMenu.nib.
2011-07-23 18:56:08.819 MakingProgress6[45116:407] Could not connect the action doProcess: to target of class NSObject
2011-07-23 18:56:08.825 MakingProgress6[45116:407] An uncaught exception was raised
2011-07-23 18:56:08.825 MakingProgress6[45116:407] [<NSObject 0x4008680a0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key theFruit.
2011-07-23 18:56:08.827 MakingProgress6[45116:407] (
0 CoreFoundation 0x00007fff839be986 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8342cd5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff83a485a9 -[NSException raise] + 9
3 Foundation 0x00007fff8a169e6f -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 240
4 Foundation 0x00007fff8a0a0d96 _NSGetUsingKeyValueGetter + 108
5 Foundation 0x00007fff8a0a0d1d -[NSObject(NSKeyValueCoding) valueForKey:] + 392
6 Foundation 0x00007fff8a0c079e -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 348
7 AppKit 0x00007fff8d783baa -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] + 654
8 AppKit 0x00007fff8d783894 -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 171
9 AppKit 0x00007fff8d986352 -[NSValueBinder _referenceBindingValue] + 31
10 AppKit 0x00007fff8d986163 -[NSValueBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 647
11 AppKit 0x00007fff8dcb2018 -[NSSelectionBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 852
12 AppKit 0x00007fff8d985e48 -[NSValueBinder _observeValueForKeyPath:ofObject:context:] + 303
13 AppKit 0x00007fff8dcb1cb5 -[NSSelectionBinder observeValueForKeyPath:ofObject:change:context:] + 305
14 AppKit 0x00007fff8d77585b -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591
15 AppKit 0x00007fff8d76eb81 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1079
16 AppKit 0x00007fff8d7651b9 loadNib + 322
17 AppKit 0x00007fff8d7646b6 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
18 AppKit 0x00007fff8d7645d1 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
19 AppKit 0x00007fff8d764514 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364
20 AppKit 0x00007fff8d9d7355 NSApplicationMain + 398
21 MakingProgress6 0x0000000100000eef main + 79
22 MakingProgress6 0x0000000100000e94 start + 52
23 ??? 0x0000000000000001 0x0 + 1
)
2011-07-23 18:56:09.030 MakingProgress6[45116:407] *** Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[<NSObject 0x4008680a0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key theFruit.’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff839be986 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8342cd5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff83a485a9 -[NSException raise] + 9
3 Foundation 0x00007fff8a169e6f -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 240
4 Foundation 0x00007fff8a0a0d96 _NSGetUsingKeyValueGetter + 108
5 Foundation 0x00007fff8a0a0d1d -[NSObject(NSKeyValueCoding) valueForKey:] + 392
6 Foundation 0x00007fff8a0c079e -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 348
7 AppKit 0x00007fff8d783baa -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] + 654
8 AppKit 0x00007fff8d783894 -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 171
9 AppKit 0x00007fff8d986352 -[NSValueBinder _referenceBindingValue] + 31
10 AppKit 0x00007fff8d986163 -[NSValueBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 647
11 AppKit 0x00007fff8dcb2018 -[NSSelectionBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 852
12 AppKit 0x00007fff8d985e48 -[NSValueBinder _observeValueForKeyPath:ofObject:context:] + 303
13 AppKit 0x00007fff8dcb1cb5 -[NSSelectionBinder observeValueForKeyPath:ofObject:change:context:] + 305
14 AppKit 0x00007fff8d77585b -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591
15 AppKit 0x00007fff8d76eb81 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1079
16 AppKit 0x00007fff8d7651b9 loadNib + 322
17 AppKit 0x00007fff8d7646b6 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
18 AppKit 0x00007fff8d7645d1 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
19 AppKit 0x00007fff8d764514 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364
20 AppKit 0x00007fff8d9d7355 NSApplicationMain + 398
21 MakingProgress6 0x0000000100000eef main + 79
22 MakingProgress6 0x0000000100000e94 start + 52
23 ??? 0x0000000000000001 0x0 + 1
)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language: auto; currently objective-c
(gdb)

This is unrelated to the project, but it means you should update Adobe Unit Types.osax (they have it available for download somewhere).

See above.

That sounds odd, perhaps a problem with the class file.

The last of these is a bindings problem, but all three probably relate to the one before.

Email me the project.

So you have two problems. The first is that the script label in your app delegate is Making_progress6AppDelegate, but the file is named MakingProgress6AppDelegate.applescript. I don’t know how that happened, but it means that the blue cube representing the app delegate is looking for a class called MakingProgress6AppDelegate, and there isn’t one.

The second problem is that your binding for the stepper is incorrect; you have a Model Key Path of self instead of theNumber.

You can download the 64 bit version of adobe unit types here:

http://kb2.adobe.com/cps/516/cpsid_51615.html

:slight_smile:

Did you manage to get this working for you?

I’m experiencing a very similar problem on Lion 10.7.2 Xcode 4.2 Did sorting out the bindings fix this?

Here’s my log

GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 8 20:32:45 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “x86_64-apple-darwin”.tty /dev/ttys000
[Switching to process 4534 thread 0x0]
2011-11-09 21:25:32.935 makingProgress[4534:407] -[_NSControllerObjectProxy copyWithZone:]: unrecognized selector sent to instance 0x400e4e2a0
2011-11-09 21:25:32.936 makingProgress[4534:407] An uncaught exception was raised
2011-11-09 21:25:32.937 makingProgress[4534:407] -[_NSControllerObjectProxy copyWithZone:]: unrecognized selector sent to instance 0x400e4e2a0
2011-11-09 21:25:32.940 makingProgress[4534:407] (
0 CoreFoundation 0x00007fff92493286 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff9133bd5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9251f4ce -[NSObject doesNotRecognizeSelector:] + 190
3 CoreFoundation 0x00007fff92480133 forwarding + 371
4 CoreFoundation 0x00007fff9247ff48 _CF_forwarding_prep_0 + 232
5 AppKit 0x00007fff98afc5dc -[NSCell _setContents:] + 73
6 AppKit 0x00007fff98afc4b9 -[NSCell setObjectValue:] + 160
7 AppKit 0x00007fff98d1f7bc -[_NSPlaceholderTextFieldPlugin showValue:inObject:] + 388
8 AppKit 0x00007fff98d07b45 -[NSValueBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 809
9 AppKit 0x00007fff98d07788 -[NSValueBinder _observeValueForKeyPath:ofObject:context:] + 303
10 AppKit 0x00007fff98d1f5af -[NSTextValueBinder _observeValueForKeyPath:ofObject:context:] + 43
11 AppKit 0x00007fff98af5bdb -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591
12 AppKit 0x00007fff98aeeef5 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1079
13 AppKit 0x00007fff98ae552f loadNib + 322
14 AppKit 0x00007fff98ae4a28 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
15 AppKit 0x00007fff98ae4943 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
16 AppKit 0x00007fff98ae4886 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364
17 AppKit 0x00007fff98d58637 NSApplicationMain + 398
18 makingProgress 0x0000000100000efa main + 74
19 makingProgress 0x0000000100000ea4 start + 52
20 ??? 0x0000000000000003 0x0 + 3
)
2011-11-09 21:25:32.956 makingProgress[4534:407] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[_NSControllerObjectProxy copyWithZone:]: unrecognized selector sent to instance 0x400e4e2a0’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff92493286 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff9133bd5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9251f4ce -[NSObject doesNotRecognizeSelector:] + 190
3 CoreFoundation 0x00007fff92480133 forwarding + 371
4 CoreFoundation 0x00007fff9247ff48 _CF_forwarding_prep_0 + 232
5 AppKit 0x00007fff98afc5dc -[NSCell _setContents:] + 73
6 AppKit 0x00007fff98afc4b9 -[NSCell setObjectValue:] + 160
7 AppKit 0x00007fff98d1f7bc -[_NSPlaceholderTextFieldPlugin showValue:inObject:] + 388
8 AppKit 0x00007fff98d07b45 -[NSValueBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 809
9 AppKit 0x00007fff98d07788 -[NSValueBinder _observeValueForKeyPath:ofObject:context:] + 303
10 AppKit 0x00007fff98d1f5af -[NSTextValueBinder _observeValueForKeyPath:ofObject:context:] + 43
11 AppKit 0x00007fff98af5bdb -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591
12 AppKit 0x00007fff98aeeef5 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1079
13 AppKit 0x00007fff98ae552f loadNib + 322
14 AppKit 0x00007fff98ae4a28 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
15 AppKit 0x00007fff98ae4943 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
16 AppKit 0x00007fff98ae4886 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364
17 AppKit 0x00007fff98d58637 NSApplicationMain + 398
18 makingProgress 0x0000000100000efa main + 74
19 makingProgress 0x0000000100000ea4 start + 52
20 ??? 0x0000000000000003 0x0 + 3
)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language: auto; currently objective-c
kill
quit
Program ended with exit code: 0