• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
applescript objectSpecifier error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

applescript objectSpecifier error


  • Subject: applescript objectSpecifier error
  • From: Jesse Grosjean <email@hidden>
  • Date: Tue, 13 Jan 2004 16:25:00 -0500

Somehow the objectSpecifier that my objects are retuning is incorrect. I've created a small simple project to demonstrate the problem that you can download here:

http://www.gooeyball.com/ScriptTest.zip

This download contains an xcode project and also a small test script that when run in the script editor will return:

{row 1 of +class ; +constant ****all ; of document "Untitled" of application "ScriptTest"}

when it should be returning

{row 1 of root of document "Untitled" of application "ScriptTest"}

I've seen this problem reported on both this list and the omnigroup list, but a solution has never been posted. Does anyone know how I can go about fixing it? I've included my objectSpecifier implementation and my sdef file at the end of this message for those who don't want to download the project.

Thanks for any help, pointers, or suggestions,
Jesse

- (NSScriptObjectSpecifier *)objectSpecifier {
Node *parent = [self parent];
if (parent) {
unsigned index = [parent indexOfObjectInSubnodes:self];
if (index != NSNotFound) {
NSScriptObjectSpecifier *containerRef = [parent objectSpecifier];
return [[[NSIndexSpecifier alloc] initWithContainerClassDescription:[containerRef keyClassDescription] containerSpecifier:containerRef key:@"subnodes" index:index] autorelease];
}
} else if ([self document]) {
NSScriptObjectSpecifier *containerRef = [[self document] objectSpecifier];
return [[[NSPropertySpecifier alloc] initWithContainerClassDescription:[containerRef keyClassDescription] containerSpecifier:containerRef key:@"root"] autorelease];
}

return nil;
}

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">

<dictionary title="ScriptTest Terminology">
<suite name="ScriptTest Suite" code="STss" description="ScriptTest Scripting Support.">
<classes>
<class name="document" inherits="document" code="cdoc">
<cocoa class="MyDocument"/>
<properties>
<property name="root" access="r" code="STrt" type="row"/>
</properties>
</class>
<class name="row" inherits="item" code="STnd">
<cocoa class="Node"/>
<elements>
<element name="rows" code="STnd" type="row">
<cocoa method="subnodes"/>
</element>
</elements>
<properties>
<property name="id" code="ID " type="number" access="r">
<cocoa method="uniqueID"/>
</property>
<property name="name" code="pnam" type="string"/>
</properties>
</class>
</classes>
</suite>
</dictionary>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: applescript objectSpecifier error
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Re: Input Panel
  • Next by Date: Re: Setting a documents file type during save as=8 5
  • Previous by thread: Recent Documents / Trash Issue ...
  • Next by thread: Re: applescript objectSpecifier error
  • Index(es):
    • Date
    • Thread