• 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: os x gui scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: os x gui scripting


  • Subject: Re: os x gui scripting
  • From: Andrew Farmer <email@hidden>
  • Date: Tue, 23 Dec 2008 01:16:21 -0800

On 22 Dec 08, at 02:58, Luca Cioria wrote:
If you say so.. but for example how would you click at specified coordinates
in applescript? or get a pixel color?
Of course, if an app is scriptable I use appscpt or automator, but in many
case, even websites, I have to follow this path.

If you're working with a web site, use Safari's "do JavaScript" verb. But if you're working some other truly recalcitrant application, the following sort of thing works:


  tell application "Firefox" to activate
  tell application "System Events"
    tell process "Firefox"
      click at {26, 12}
    end tell
  end tell

Note that the coordinates are absolute by default... this is NOT a particularly robust solution.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >os x gui scripting (From: "Luca Cioria" <email@hidden>)
 >Re: os x gui scripting (From: Andrew Farmer <email@hidden>)
 >Re: os x gui scripting (From: "Luca Cioria" <email@hidden>)

  • Prev by Date: Re: Debugging memory smashers with GC
  • Next by Date: Re: NSCalendar/NSDate - generating all months/days in a year
  • Previous by thread: Re: os x gui scripting
  • Next by thread: Re: os x gui scripting
  • Index(es):
    • Date
    • Thread