On 21 Dec 08, at 06:47, Luca Cioria wrote:
First, I know little of os x programming since I bought my mac 2 weeks ago.

I'd like to develop a set of command line tools that do gui scripting stuff.
Some examples:

click --> clicks the mouse at x y coordinates, optionally relative to
current window, can be single click, double click, right, middle, mouse-down
only (no releasing) etc. etc.
getPixel --> get the color of a pixel on the screen at x y coordinates,
optionally relative to current window.
send --> sends keystrokes
winActivare --> activate a specified window

What you're looking for here is AppleScript. The AppleScript component "GUI Scripting" has most of the low-level gunk you're looking for, as well as a lot of higher-level functionality (clicking specified buttons or views). Scriptable applications can be manipulated in much better ways - TextEdit, for example, will let you do stuff like

    tell application "TextEdit"
set word 3 of paragraph 1 of text of document of front window to "know"
    end tell

Although most of this functionality *is* accessible through Cocoa, it's a lot more awkward to get at that way, and there's no real advantage to doing so. If all you're after is an equivalent to AHK, AppleScript is the way to go.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to