• 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
Re: Passing *possible* variables to a handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing *possible* variables to a handler


  • Subject: Re: Passing *possible* variables to a handler
  • From: email@hidden
  • Date: Thu, 18 Jul 2002 22:21:43 -0400

Thu, 18 Jul 2002 15:16:44 -0400, "Arthur J. Knapp" <email@hidden>
noted,

>> Ey lad, looks like you've almost incidentally discovered constructor
>> functions (except that your example above doesn't actually return the
>> script object created).
>
> ???
>
> Sure it does:
>
> on hand()
> script o
> property p : 3.14159
> end
> end
>
> hand() --> <<script o>>
>
>
> Initialized script objects return a result just like any other
>data type on a line by it self:
>
> script
> property o : 3.14159
> end
>
> set obj to result --> <<script>>

I've found that a named script (like "script a" above) does NOT return a result
value when in the implicit run handler, but does in an explicit handler,
including the explicit run handler.

script o
property p : 3.14159
end

set obj to result --> Error. "The variable result is not defined.

Apparently, a named script at the outermost level of the script is a
compile-time entity, like a property declaration. Thus,

42
script o
property p : 3.14159
end script

set obj to result --> 42

But change "script o" to just "script", and you get,

42
script o
property p : 3.14159
end script

set obj to result --> <<script>>

Very misleading!
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Determining frontmost application in OS X
  • Next by Date: Re: Determining frontmost application in OS X
  • Previous by thread: Re: Passing *possible* variables to a handler
  • Next by thread: Re: Passing *possible* variables to a handler
  • Index(es):
    • Date
    • Thread