• 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
a script object (class) as a member of another script object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a script object (class) as a member of another script object


  • Subject: a script object (class) as a member of another script object
  • From: "Rua Haszard Morris" <email@hidden>
  • Date: Mon, 29 Sep 2003 15:41:40 +1000

Hi,

I'm new to applescript, and am coming to terms with its concept of
'class'/'object' - 'script object', right?

The question I have is how do I define a class in one file (so I can have a
lib which is my class/script object, let's say a counter object), and use it
in another as a property? To be clear i want to use an instance of a script
object (class) as a property (member) of another class.

e.g.
file counter.lib:
script Counter
property Max : 5
property Current : 1;
property NumWrapArounds : 0;

on Count
set my Max to my Max + 1
...
end

...
end

file counteruser:
-- import the counter.lib file somehow? maybe set counterlib to load script
file "counter.lib"
script CounterUser
property mecounterobj : Counter --i.e. an instance of the counter above

...
end

Is there a way to do this?

If so, assuming that there are multiple ways to do it (as there are a couple
to define a class I beleive), what is the 'normal'/'correct' method?

Any help would be greatly appreciated...

Thanks,
Rua HM.

Rua Haszard Morris
Software Engineer & Research Assistant
MARCS Auditory Laboratories
http://www.uws.edu.au/marcs
Ph +61 2 97726723 Fax +61 2 97726326
_______________________________________________
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.

  • Follow-Ups:
    • Re: a script object (class) as a member of another script object
      • From: Paul Berkowitz <email@hidden>
    • Re: a script object (class) as a member of another script object
      • From: tim bates <email@hidden>
  • Prev by Date: Re: get eof real?
  • Next by Date: Re: Bug in (scripting) Excel.
  • Previous by thread: [ANN] AppleScript for Absolute Starters (AS4AS)
  • Next by thread: Re: a script object (class) as a member of another script object
  • Index(es):
    • Date
    • Thread