• 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
Numbers '09 and AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Numbers '09 and AppleScript
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: Re: Adobe Reader Problem
  • Next by Date: Another Numbers bug
  • Previous by thread: Re: Adobe Reader Problem
  • Next by thread: Re: Numbers '09 and AppleScript
  • Index(es):
    • Date
    • Thread