Numbers '09 and AppleScript
Numbers '09 and AppleScript
- Subject: Numbers '09 and AppleScript
- From: KOENIG Yvan <email@hidden>
- Date: Thu, 19 Feb 2009 23:18:45 +0100
This time I double checked. It's Numbers '09.
As the function DUPLICATE refuse to duplicate a sheet, I tried to use
GUI scripting.
With this script:
--[SCRIPT]
set mySheet to "Name1"
tell application "Numbers" to activate
tell application "System Events" to tell (first process whose title
is "Numbers")
tell window 1 to tell splitter group 1 to tell splitter group 1 to
tell scroll area 1 to tell outline 1
get properties of UI elements
set nbr to get count of rows
set sheetPos to {0, 0}
repeat with r from 1 to nbr
tell static text 1 of row r
if value is mySheet then
set sheetPos to position
exit repeat
end if
end tell -- static text 1 of row r
end repeat
if sheetPos is {0, 0} then error "the “" & mySheet & "” is
missing ! "
--click static text 1 of row r
set value of attribute "AXFocused" of static text 1 of row r to true
delay 0.1
click static text 1 of row r
--keystroke "d" using {command down}
end tell -- outline …
end tell
--[/SCRIPT]
I am able to put the focus on the thumbnails dedicated to the sheet
whose name is defined by mySheet.
Alas after that, the menu Duplicate remains grayed so I can't apply
the keystroke command to duplicate de sheet.
Is one of you able to tell what is wrong ?
Yvan KOENIG (from FRANCE jeudi 19 février 2009 22:42:26)
_______________________________________________
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