Mailing Lists: Apple Mailing Lists

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

Re: Implementing a new command



On Nov 19, 2007, at 2:31 PM, Philip Aker wrote:

It's just that I got an error about the code for "id" not being 4 characters in length ('ID  ') and couldn't tell if it was in your original file or not.

That error catch is new in Leopard I think.

Ahh ok, thank you for having me check that. I checked all my "ID  " types and they look good so it may have been a glitch in the transfer.

I am amazed at how fast I can now implement new objects into my Applescript model now that things have fallen into place a little bit.

I have Orders, which can have OrderSteps, which themselves can have OrderSteps, ad infinitum, and the Applescript works great for it!

I have OperationTypes which are the objects that stand for the type of work that has to be done to an OrderStep. I might just go crazy and implement my workCenters into this whole thing.

As it is, I have success with this crazy, yet possibly useful script:

tell application "Scheduler"
activate


set orderNumber to "22222"


set myOrder to scheduled order id orderNumber


set children to order steps of myOrder


set grandchildren to order steps of first item of children


name of operation type of first item of grandchildren


end tell

One trick I had to do was to put an if () on the objectSpecifier method of my OrderStep object because the "parent" of an OrderStep can be the Order itself (ie the "root") or it could be another OrderStep which might be the "child" (or grandchild, etc) of the Order. So depending, I had to make the container be either an Order object, or an OrderStep object.


 _______________________________________________
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: Philip Aker <email@hidden>)
 >Re: Implementing a new command (From: Paul Bruneau <email@hidden>)
 >Re: Implementing a new command (From: Philip Aker <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.