Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird -1700 error



The following script works:

	tell application "CD-AS Test"
		tell the first document
			tell the first note
				get name
			end tell
		end tell
	end tell

	Result: "Untitled 1"

However, the next script fails:

	tell application "CD-AS Test"
		tell the first document
			set theNote to the first note
			get the name of theNote
		end tell
	end tell

Result: CD-AS Test got an error: Can't make name of note id "x- coredata:///Note/tDEAFB076-1053-485B-BBE0-AC51F30308F4"; of document "Untitled" into type reference.

I added some trace functions to this demo app to see what was happening and got the following:

CD-AS Test[6555] Command: Standard Suite.get
Direct Parameter: <NSIndexSpecifier: notes 1 of orderedDocuments 1>
Receivers: <NSIndexSpecifier: notes 1 of orderedDocuments 1>
Arguments: {}
CD-AS Test[6555] -[MyDocument respondsToSelector:]:117 selector search for indicesOfObjectsByEvaluatingObjectSpecifier:
CD-AS Test[6555] -[MyDocument indicesOfObjectsByEvaluatingObjectSpecifier:]:82 called
CD-AS Test[6555] -[MyDocument indicesOfObjectsByEvaluatingObjectSpecifier:]:100 not an ID specifier
CD-AS Test[6555] -[MyDocument respondsToSelector:]:117 selector search for valueInNotesAtIndex:
CD-AS Test[6555] -[MyDocument notes]:58 called
CD-AS Test[6555] -[Note respondsToSelector:]:100 selector search for descriptionWithLocale:
CD-AS Test[6555] -[Note name]:16 called
CD-AS Test[6555] Property Value: <Note: 0x32a2d0> (entity: Note; id: 0x312c20 <x-coredata:///Note/tDEAFB076-1053-485B-BBE0-AC51F30308F4> ; data: {
name = "Note 1";
})
CD-AS Test[6555] -[Note respondsToSelector:]:100 selector search for _scriptingDescriptorOfObjectType:orReasonWhyNot:
CD-AS Test[6555] -[Note objectSpecifier]:79 called
CD-AS Test[6555] -[Note identifier]:72 called
CD-AS Test[6555] Result: <NSAppleEventDescriptor: 'obj '{ 'from':'obj '{ 'from':''null''(), 'want':'docu', 'form':'name', 'seld':'utxt'($55006E007400690074006C0065006400$) }, 'want':'Note', 'form':'ID ', 'seld':'utxt'($78002D0063006F007200650064006100740061003A002F002F002F004 E006F00…$) }
CD-AS Test[6555] Error converting apple event to script command: -1700
CD-AS Test[6555] Original event: <NSAppleEventDescriptor: 'core'\'getd'{ '----':'obj '{ 'form':'prop', 'want':'prop', 'seld':'pnam', 'from':'obj '{ 'form':'ID ', 'want':'Note', 'seld':'utxt'($78002D0063006F007200650064006100740061003A002F002F002F004 E006F00…$), 'from':'obj '{ 'form':'name', 'want':'docu', 'seld':'utxt'($55006E007400690074006C0065006400$), 'from':''null''() } } }, &'csig':65536 }
CD-AS Test[6555] Expected type: 'obj '
CD-AS Test[6555] Offending object descriptor: <NSAppleEventDescriptor: 'obj '{ 'form':'prop', 'want':'prop', 'seld':'pnam', 'from':'obj '{ 'form':'ID ', 'want':'Note', 'seld':'utxt'($78002D0063006F007200650064006100740061003A002F002F002F004 E006F00…$), 'from':'obj '{ 'form':'name', 'want':'docu', 'seld':'utxt'($55006E007400690074006C0065006400$), 'from':''null''() } } }



As best I can tell, if I talk to one object at a time, it works great. If I try to store a reference to an object, it fails to ever create an event with that reference. What could be going on?




Adam Knight
If you're not going to stop and appreciate the scenery, you're not going to
enjoy Myst. The same thing applies on the Mac as well. -- Rand Miller


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.