• 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: Dynamic Handler Call
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic Handler Call


  • Subject: Re: Dynamic Handler Call
  • From: has <email@hidden>
  • Date: Mon, 10 Apr 2006 00:37:29 +0100

Gary Beberman wrote:

>That's great.  Thanks for the suggestion.  Not that I want to push my luck, but is there some way I could pass parameters into the script, also?

I assume you mean pass parameters to the subroutine, which you do as normal:

script obj1
	on foo(s, n)
		repeat n times
			say "hello " & s
		end repeat
	end foo
end script

script obj2
	on foo(s, n)
		repeat n times
			say "goodbye " & s
		end repeat
	end foo
end script

set hlist to {{searchtext:"text string 1", obj:obj1}, {searchtext:"text string 2", obj:obj2}}

set s to "text string 2"
repeat with rec in hlist
	if searchtext of rec is s then foo(s, 3) of obj of rec
end repeat

HTH

has
--
http://freespace.virgin.net/hamish.sanderson/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Dynamic Handler Call (From: has <email@hidden>)
 >Re: Dynamic Handler Call (From: Gary Beberman <email@hidden>)

  • Prev by Date: Re: Dynamic Handler Call
  • Next by Date: Re: Store script as run only
  • Previous by thread: Re: Dynamic Handler Call
  • Next by thread: Re: Dynamic Handler Call
  • Index(es):
    • Date
    • Thread