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

Re: Numbers and AppleScript


  • Subject: Re: Numbers and AppleScript
  • From: "koenig.yvan" <email@hidden>
  • Date: Sat, 06 Sep 2014 11:12:17 +0200

Huge thanks to the numerous authors of answers ;-)

Here is a piece of code doing the trick.
It appears that trying to click the button defined by its index is a bad idea.
Defining it by its name works well.

#=====

my Rechercher_Remplacer("lapin", "la" & linefeed & "pin")

#=====

on Rechercher_Remplacer(avant, |après|)
tell application "Numbers" to activate


tell application "System Events" to tell application process "Numbers"
keystroke "f" using {command down}
title of window 1
--> "Rechercher et remplacer"
tell window result
set value of first text field to avant
set value of second text field to |après|
title of button -3 # To get the button's name
--> "Tout remplacer"
click button result
end tell
keystroke "w" using {command down} # Close the dialog
end tell -- System Events…
return
end Rechercher_Remplacer

#=====


Yvan KOENIG (VALLAURIS, France) samedi 6 septembre 2014 11:11:34




 _______________________________________________
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: 
 >Numbers and AppleScript (From: "koenig.yvan" <email@hidden>)

  • Prev by Date: Re: Adobe Photoshop Bounds of a layer?
  • Next by Date: Scripting a user login in Mavericks?
  • Previous by thread: Numbers and AppleScript
  • Next by thread: Adobe Illustrator saving files using Applescript and Artboards
  • Index(es):
    • Date
    • Thread