• 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: Looking for clarification on Applescript event handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for clarification on Applescript event handlers


  • Subject: Re: Looking for clarification on Applescript event handlers
  • From: John Delacour <email@hidden>
  • Date: Mon, 11 Aug 2003 00:46:45 +0100

At 4:43 pm -0400 10/8/03, Chris Backas wrote:

The NSAppleScript class has an executeAppleEvent method, which takes an AppleEventDescriptor as an argument. I've seen on the Applescript side that one makes an event handler something like:

on <some event>(<some argument>)
<do stuff>
end <some event>

My confusion is, does that single AppleEventDescriptor I pass encompass both <some event> and <some argument> ? If I want to pass a list to a handler in an applescript, do I need to declare my own kind of handler someplace with its own ID, or are there preexisting ones that I'm meant to utilize?

The two handlers below are equivalent. You will only be able to read this properly in the Bcc. owing to the narcolepsy of the list administrators.


on +event makelist; given +class LIST;:_somelist
set AppleScript's text item delimiters to return
set s to _somelist as Unicode text
set AppleScript's text item delimiters to ""
return s
end +event makelist;
set x to +event makelist; given +class LIST;:{1, 2, 3, ""}

on makeList(ls)
set AppleScript's text item delimiters to return
set s to ls as Unicode text
set AppleScript's text item delimiters to ""
return s
end makeList
set y to makeList({4, 5, 6})

x & y
_______________________________________________
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.

References: 
 >Looking for clarification on Applescript event handlers (From: Chris Backas <email@hidden>)

  • Prev by Date: More Mail fun
  • Next by Date: Mail Documents
  • Previous by thread: Looking for clarification on Applescript event handlers
  • Next by thread: Re: Looking for clarification on Applescript event handlers
  • Index(es):
    • Date
    • Thread