• 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 20:23:58 +0100

I tried to code what you do by hand:

my activateGUIscripting()

tell application "Numbers"
tell document 1 to tell sheet 1 to tell table 1
set value of cell "D2" to "6453"
my shortcut("Numbers", "c", "c")
set selection range to range "D2:D45"
delay 0.2
my shortcut("Numbers", "v", "c")
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
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 tell
end shortcut

--=====

I don't understand why it doesn't do the wanted job.

Your own code will behave faster if the target table is not displayed.
I often use this trick.

Yvan KOENIG (VALLAURIS, France) mercredi 25 novembre 2009 20:23:18






 _______________________________________________
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: Very slow Applescript operation in iWork Numbers 09
      • From: Yvan KOENIG <email@hidden>
References: 
 >Very slow Applescript operation in iWork Numbers 09 (From: Mads Fog Albrechtslund <email@hidden>)

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