GUI Scripting: Incrementor

I’m attempting to script the iBeeZz pref pane via GUI scripting. Everything was going along smoothly until I came to the incrementors for the time. :?

I can make the script click the up and down arrows but the time doesn’t change. Any ideas?

I’m getting the same experience.
Working on iCal Print window, clicking date incrementor buttons or using increment/decrement is not changing the date.

A suggestion would be very very appreciated.

instead of clicking the up and down incrementor buttons maybe “keystroke” the time etc in?

Actually I tried with:

  • click button 1 of incrementor 1
    and
  • increment incrementor 1

Both are showing me the incrementor button that’s clicking but date doesn’t change.

Please could you explain me better what to do with “keystroke”?

Thanks a lot!

Have you seen increment incrementor 1 and decrement incrementor 1 used for this purpose?

It doesn’t’ look like you can get the required granularity to change the values for AXDateTimeArea.

I wonder if you can specify the incrementer of the AXDateTimeArea control.

Model: iMac Core Duo 17"
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Yes, granularity could be.

But even doing the same on the second incrementor (End: “after” ) where the value is defined by a number (integer >=1) of days the same click or increment request is not working.
Again I see the buttons clicked down but nothing is changing.

FYI: application is “iCal”, window “Print”, UI elements Start and End

can you supply some code for what youre working on?

ok been mucking about a bit, you need to set the value of the text field.

activate application “iCal”
tell application “System Events”
tell process “iCal”
click menu item “Print.” of menu 1 of menu bar item “File” of menu bar 1
set value of text field 1 of window “Print” to “9”
end tell
end tell

Amazing! It’s working fine now…
Thanks a lot!!!

But… how did you discovered this?
I mean, I checked with Accessibility Inspector and the mouse over the text field didn’t return nothing.
I tried also this on the print window:

repeat with i from 1 to count each UI element
        position of UI element i
	role of UI element i
	title of UI element i
	value of UI element i
end repeat

…and actually I see that’s the TextField object is present.

By the way, just for information, is there a possibility to set the incrementor value of the “start: in date” text field?
Inspector is returning nothing and even with my repeat loop above I don’t get nothing that allows me to set it.
Actually I don’t need this feature, is just for knowledge.

Thanks again for your precious support!!!

cool, glad that’s what youre after :slight_smile:

Where abouts is this?,
“set the incrementor value of the “start: in date” text field?”

To obtain the information I gave you, I used “PreFab UI Browser” from http://prefabsoftware.com/uibrowser/
really great tool for UI scripting, their is also “UIElementInspector” from http://developer.apple.com/samplecode/UIElementInspector/index.html

When you look to the “Print” window and set the “Start” pup up button to “on date” (I suppose this should be in english iCal) you get an incrementor on right side with a date.
If I tell to this incrementor to increment or to click to its buttons the date doesn’t change; moreover there’s no information about the text field containing the date (like for “days” text field below).

Thanks again!

this seems to do it

activate application “iCal”
tell application “System Events”
tell process “iCal”
click menu item “Print.” of menu 1 of menu bar item “File” of menu bar 1
set value of text field 1 of window “Print” to “3”
set value of text field 2 of window “Print” to “2000”
end tell
end tell