Hi, all!
I am a very new AppleScripter; I am using it to automate things for Dragon Dictate so I can gradually go hands-free. Therefore I am looking to do some very basic things in Excel 2011.
Right now the problem is clicking the AutoSum button in the Standard toolbar of the active window. I know I have to send things through System Events, but I can't get the following line of the script:
The portion in the angle brackets is the closest I've come. It told me that access was denied. I've tried dozens of other things, including using "command bar control 2" instead of "AutoSum" (a document at MicroSoft said that was the correct number for that control back in version 2004, and I could find nothing more recent).
I imagine I'm missing something very obvious, but I cannot find it anywhere on the Web. Does anyone here know how to do this?
Thank you!
K
On edit:
OK, I've made a little progress. I found an old app Apple used to make available called UIElementInspector. I discovered that the items I am trying to access are in a few levels. I've now got this:
But I get an AppleScript error when I run it that says
I tried calling it "active window" instead of front window, but then the script wouldn't compile.
Any kind souls out there who can point out what I'm doing wrong? ^_^
Thank you!
K
I am a very new AppleScripter; I am using it to automate things for Dragon Dictate so I can gradually go hands-free. Therefore I am looking to do some very basic things in Excel 2011.
Right now the problem is clicking the AutoSum button in the Standard toolbar of the active window. I know I have to send things through System Events, but I can't get the following line of the script:
Code:
tell application "Microsoft Excel"
activate
end tell
tell application "System Events"
tell process "Microsoft Excel"
<click the button "AutoSum" of "Standard" of
window>
end tell
end tell
The portion in the angle brackets is the closest I've come. It told me that access was denied. I've tried dozens of other things, including using "command bar control 2" instead of "AutoSum" (a document at MicroSoft said that was the correct number for that control back in version 2004, and I could find nothing more recent).
I imagine I'm missing something very obvious, but I cannot find it anywhere on the Web. Does anyone here know how to do this?
Thank you!
K
On edit:
OK, I've made a little progress. I found an old app Apple used to make available called UIElementInspector. I discovered that the items I am trying to access are in a few levels. I've now got this:
Code:
tell application "Microsoft Excel"
activate
end tell
tell application "System Events"
tell process "Microsoft Excel"
click button "AutoSum" of group "AutoSum" of tool
bar "Standard" of front window
end tell
end tell
But I get an AppleScript error when I run it that says
System Events got an error: Cant get tool bar "Standard" of window 1 of process "Microsoft Excel".
I tried calling it "active window" instead of front window, but then the script wouldn't compile.
Any kind souls out there who can point out what I'm doing wrong? ^_^
Thank you!
K
Last edited: