| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Feb 12, 2005, at 9:17 AM, Irwin Poche wrote:
If you need to call a subroutine from within a Tell statement, you must use the reserved words of me or my to indicate that the subroutine is part of the script (not a command that should be sent to the object of the Tell statement). For example, the minimumValue subroutine call in the following Tell statement is unsuccessful, even if the script contains the minimumValue routine defined in “A Sample Subroutine” (page 282), because AppleScript sends the minimumValue command to AppleWorks. If you run this script, you get an error message saying that AppleWorks does not understand the minimumValue message. tell front document of application "AppleWorks" minimumValue(12, 400) copy result as string to word 10 of text body end tell--result: An error, because AppleWorks doesn’t -- understand the minimumValue message. statement, the subroutine call is successful, because AppleScript knows that the subroutine is part of the script. tell front document of application "AppleWorks" minimumValue(12, 400) of me copy result as string to word 10 of text body end tell --result: The subroutine call is successful. You can use the word my before the subroutine call as a synonym for the words of me after the subroutine call. For example, the following two subroutine calls are equivalent: minimumValue(12, 400) of me my minimumValue(12, 400) Chris |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden This email sent to email@hidden
| References: | |
| >Handlers in applications (From: Irwin Poche <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.