Mailing Lists: Apple Mailing Lists

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

Problems with "open file" just won't go away...



Thanks to Bill Cheeseman, I scrapped the old NSCoreSuite.sdef, which is out of date, and incorporated the Skeleton.sdef Core Suite definitions.

Well, I am still getting errors with open event.

I did more digging and here is what I found. If you use the Skeleton open command as is, it says that the direct object can be either a file or a list.

<command name="open" code="aevtodoc" description="Open a document.">
  <direct-parameter description="The file(s) to be opened.">
    <type type="file"/>
    <type type="file" list="yes"/>
  </direct-parameter>
  <!--
    According to TN2106, 'open' should return the resulting document
    object.  However, the Cocoa implementation does not do this yet.
    <result type="specifier"/>
  -->
</command>

With this as is, I get NSLog lines in XCode when running my app:

2006-09-12 10:23:52.754 MyApp[396] *** -[NSCFString count]: selector not recognized [self = 0x391160]

which points back to my earlier comments that XCode is getting an object as the direct parameter, not a list.


So, I change the above by removing the "<type type="file"/>" line, so now it says it ONLY accepts a list.


All starts working again.

So, you say maybe I'm doing something funky in my app. Well, I created a NEW Cocoa document based application, with no added code. I modified the info.plist file to say it is AppleScriptable and to refer to the Skeleton.sdef file EXACTLY as it is - not a character changed.

Go to Script Editor, tell this app to open such and such, and it give the EXACT same error message as my app (the NSCFString message above). Then, I modify Skeleton.sdef to take out the same line I did in my app:

    <type type="file"/>,

and voila, the script runs with a "real" error message that the file cannot be opened (as I would expect).

I cannot post the project with this email, but will gladly mail it to anyone who is interested to verify my results. I even rebooted this morning just to be sure. I'm on the latest Tiger release.

I am updating rdar://4725273

David


_______________________________________________ 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
References: 
 >NSCoreSuite.sdef entry for "open file" is incorrect (From: David Hoerl <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.