| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Nov 19, 2007, at 11:14 AM, Christiaan Hofman wrote:
This mirrors my situation (but see below). Only those orders that are scheduled orders should respond to a complete command. But for a test, I did duplicate the responds-to section in my order class and my complete: method did get called! But this is not good, because it allowed any order to get sent the complete command, not just scheduled orders. What I want is exactly what Apple showed with the rotate command.
tell application "Scheduler" activate set theOrder to scheduled order id "24778" complete theOrder end tell
Sorry, here is my only one, in Order.m: - (NSScriptObjectSpecifier *)objectSpecifier { unsigned index = [[[NSApp delegate] orders] indexOfObjectIdenticalTo:self]; if (index == NSNotFound) { NSLog (@"objectSpecifier couldn't find: %@", self); return nil; } NSLog (@"objectSpecifier: %@", self); NSScriptClassDescription * containerClassDesc = (NSScriptClassDescription *)[NSScriptClassDescription classDescriptionForClass:[NSApp class]]; return [[[NSUniqueIDSpecifier alloc] initWithContainerClassDescription:containerClassDesc containerSpecifier:nil key:@"orders" uniqueID:[self pNumber]] autorelease]; }
But in my situation, I have my Cocoa Order class being used for orders and scheduled orders in AS. It will pain me to subclass orders to make a scheduled order in my Cocoa application but maybe it's not so bad? Or maybe there is some other way I can approach it. Maybe make my complete: method check to make sure it is a scheduled order and return an applescript error if it isn't. Would that be reasonable? In any case, I think this is the cause of my problem. Thank you for helping me once again. You are officially the most knowledgeable AppleScript Implementor I know :) I hope I can help some other newbie out some day.
|
_______________________________________________ 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: | |
| >Implementing a new command (From: Paul Bruneau <email@hidden>) | |
| >Re: Implementing a new command (From: Christiaan Hofman <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.