Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescripting the calculator



Title: Re: applescripting the calculator
This works for me:

tell application "System Events" to tell process "Calculator"
  
activate
       
tell group 1 of window 1
               
click button "Clear"
           
click button "9"
               
click button "plus"
            
click button "5"
               
click button "Equals"
  
end tell
       
keystroke "c" using {command down}
     
set x to (the clipboard) as number
end tell

At 2:19 PM -0500 1/24/07, Gordon Beckhart wrote:
dear friends
Been tring to teach my self applescript and this bit with the calculator has me frustrated.
The command "exists" seems to work and returns me a "true".  Trying to click, press the number buttons just returns an error message.

this is the applescript, can anyone suggest how to make it function?
thanks
Gordon Beckhart
tell application "Calculator"
       
        tell application "System Events"
               
                tell application process "calculator"
                        tell window "calculator"
                                exists button "9" of group 1
                                --exists button "Clear" of group 1
                                --click button "9" of group 1
                                --press button "plus" of group 1
                                --press button "5" of group 1 
                                --press button "equals" of group 1
                        end tell
                end tell
        end tell
end tell

s




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

This email sent to email@hidden

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

This email sent to email@hidden

References: 
 >applescripting the calculator (From: Gordon Beckhart <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.