• 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: Another Newbie on XCOdde - applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another Newbie on XCOdde - applescript


  • Subject: Re: Another Newbie on XCOdde - applescript
  • From: Philip Aker <email@hidden>
  • Date: Wed, 14 May 2008 12:55:12 -0700

On 08-05-14, at 07:42, Conrad Nolte wrote:

I am learning apple scripting specific to XCode and am not sure, if this question would be better placed in the XCode user list.

The more appropriate list is the AppleScript-Studio list: <http://lists.apple.com/mailman/listinfo/applescript-studio>.

How can I use those good old handlers of apple script in XCode applications based on apple script?

Firstly, it's a better game plan to identify theObject specifically. Otherwise, as soon as you put an on clicked hander for another object it will diligently obey the same handler code. So:

on clicked theObject
    set n to name of theObject
    if (n is "my_button") then 
        tell window of theObject
            try
                set theRate to contents of text field "rate"
                set theAmount to contents of text field "amount" as number
                set contents of text field "total" to theRate * theAmount
                (* ==== How do I call a handler In Xcode?? ==== *)
                my Handler()
            on error
                set contents of text field "total" to 0
            end try
        end tell
    end if
end clicked

on Handler()
    display dialog "It's me!"
end Handler

Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Sent from my SE/30

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Another Newbie on XCOdde - applescript (From: Conrad Nolte <email@hidden>)

  • Prev by Date: Re: Find duplicate numbers and replace
  • Next by Date: Re: AppleScript Studio & File Paths
  • Previous by thread: Another Newbie on XCOdde - applescript
  • Next by thread: Yet another Newbie
  • Index(es):
    • Date
    • Thread