Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clicking?



What's the <constant afdregfp> part?

set the front_app to the path to <constant afdregfp>

should be read and written as

    set the front_app to the path to frontmost application

So feel free to change that.

«constant afdregfp» is actually the applescript event that is send, but normally not seen. Everything in applescript has an four letter code equivalent. Events (verbs) has 8 characters and classes (noun) has four characters.
So applescript reads and send «constant afdregfp» instead of "frontmost application". But to make it easier for us to use applescript this is usually not shown to us scripters, and we see instead "frontmost application".


Why did it show the four letter code now? Honestly I don't know. But you can replace it with "frontmost application" without any problems in this case.





On 20 Jul 2005, at 20:02, Christopher Hickman wrote:


-----Original Message-----
From: applescript-studio-bounces+tophu=email@hidden
[mailto:applescript-studio-bounces+tophu=email@hidden] On Behalf
Of Romain Van Aelst
Sent: Wednesday, July 20, 2005 11:59 AM
To: applescript-studio
Subject: Re: Clicking?


Would that be helpfull?

---------------
global app_name
Appfront()
tell application app_name
     activate
     tell application "System Events"
         tell process app_name
             click at {43, 39}
         end tell
     end tell
end tell
(* Handlers *)

-- Get name of frontmost app
on Appfront()
     set the front_app to the path to <constant afdregfp>
     set the app_name to the short name of (info for the front_app)
end Appfront
---------------



On 20 Jul 2005, at 13:30, Christopher Hickman wrote:


So you want to be able to click an arbitrary set of global screen
coordinates, and you have to use pure AppleScript, without the
Studio terms?  While I'm sure you'll have to use an osax, I don't
know which one (or you'll have to write your own).  Be sure to post
back when you find your answer.  Good luck.

Topher

On Tuesday, July 19, 2005, at 11:43PM, Patrick Zittle
<email@hidden> wrote:



Thanks, close but not perfect.  Let me explain it better:

        In applescript, if I want to write a stand alone script, how
can I click a certain spot on the screen, assuming that I know the
coordinates of the spot.

        Again, thanks in advanced!

                -KZ


On Jul 19, 2005, at 7:43 PM, Christopher Hickman wrote:



        How do I click something?  I thought I knew, but it didn't
work.  So now I will ask someone who knows!




I'm assuming you mean programmatically. If you want to click a button for which you have an AppleScript name defined in Interface Builder, it's easy:

--AppleScript name of button is "myButton"
tell button "myButton" of view 1 of scroll view 1 of window 1 to
perform action
--result: myButton's on clicked handler is called

See the doc: <http://developer.apple.com/documentation/AppleScript/
Reference/StudioReference/sr5_control_suite/
chapter_5_section_30.html>

Topher








 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/rom%
40telenet.be

This email sent to email@hidden




--------------------------------------------------------- A penny for your thoughts, 20$ to act it out and 50$ to send me a picture of it.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/tophu% 40mac.com


This email sent to email@hidden





---------------------------------------------------------
A penny for your thoughts, 20$ to act it out and 50$ to send me a picture of it.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.