• 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
Re: Very slow Applescript operation in iWork Numbers 09
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Very slow Applescript operation in iWork Numbers 09


  • Subject: Re: Very slow Applescript operation in iWork Numbers 09
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 25 Nov 2009 21:22:08 +0100

Bingo

I got a code which do the trick.

my activateGUIscripting()

tell application "Numbers"
tell document 1 to tell sheet 1 to tell table 1
set value of cell "D2" to 6453
set selection range to range "D2:D45"
delay 0.2
my shortcut("Numbers", 125, "ac") (* shortcut cmd alt down arrow *)
end tell
end tell

--=====

on activateGUIscripting()
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true (* to be sure than GUI scripting will be active *)
end tell
end activateGUIscripting

--=====
(*
==== Uses GUIscripting ==== 
*)
on shortcut(a, t, d)
local k
tell application a to activate
tell application "System Events" to tell application process a
try
t * 1
if d is "c" then
key code t using {command down}
else if d is in {"ac", "ca"} then
key code t using {command down, option down}
else if d is in {"sc", "cs"} then
key code t using {command down, shift down}
else if d is in {"kc", "ck"} then
key code t using {command down, control down}
else if (d contains "c") and (d contains "s") and d contains "k" then
key code t using {command down, shift down, control down}
end if
on error
repeat with k in t
if d is "c" then
keystroke (k as text) using {command down}
else if d is in {"ac", "ca"} then
keystroke (k as text) using {command down, option down}
else if d is in {"sc", "cs"} then
keystroke (k as text) using {command down, shift down}
else if d is in {"kc", "ck"} then
keystroke (k as text) using {command down, control down}
else if (d contains "c") and (d contains "s") and d contains "k" then
keystroke (k as text) using {command down, shift down, control down}
end if
end repeat
end try
end tell
end shortcut

--=====

Yvan KOENIG (VALLAURIS, France) mercredi 25 novembre 2009 21:20:50


 _______________________________________________
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

References: 
 >Very slow Applescript operation in iWork Numbers 09 (From: Mads Fog Albrechtslund <email@hidden>)
 >Re: Very slow Applescript operation in iWork Numbers 09 (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: Very slow Applescript operation in iWork Numbers 09
  • Next by Date: Re: Graphs in AppleScript?
  • Previous by thread: Re: Very slow Applescript operation in iWork Numbers 09
  • Next by thread: Re: Very slow Applescript operation in iWork Numbers 09
  • Index(es):
    • Date
    • Thread