• 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: Script the UNSCRIPTABLE
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script the UNSCRIPTABLE


  • Subject: Re: Script the UNSCRIPTABLE
  • From: Andy Wylie <email@hidden>
  • Date: Sun, 08 Dec 2002 10:21:46 +0000

on Sat, 7 Dec 2002 09:49:56 -0400 Bill Briggs wrote:

> In the absence of any information about the elements in the dialog,
>you need to get the x,y coordinates of the particular element
>manually. You can do this in a number of ways, but an easy way is to
>take a screen shot of the dialog box and then open the image in
>Graphic Converter. Graphic Converter has a tiny window you can open
>that shows the position of the cross-hair cursor. Using this you can
>get the pixel coordinates of any or all of the elements in the
>dialog. Then you should be able to manipulate them based on position
>instead of name. I'd be very surprised if Player can't make this work
>for you.

aw Bill, are we not scripters? ; here's a couple of x,y coordinate grabbers,
an Akua one you can run from Apple Menu or such and a Smile text window
button...


property butt1 : {"Snap Coords", "Cancel"}
property butt2 : {"Repeat", "Done"}
property bla1 : "Place the cursor at the desired position and press the
enter key"
property bla2 : "The coordinates {"
property bla3 : "} are on the clipboard "

dlg1()

on dlg1()
display dialog bla1 buttons butt1 with icon -19133 default button 1
set dlgRslt to button returned of result
if dlgRslt = "Snap Coords" then return dlg2()
end dlg1

on dlg2()
set {x, y} to pointer location of (input state) --Akua Sweets OSAX
display dialog bla2 & {x, " : ", y, bla3} buttons butt2 with icon -20020
default button 1
set dlgRslt to button returned of result
if dlgRslt is "Done" then
set the clipboard to "{" & {x, ",", y, "}"}
return
else
return dlg2()
end if
end dlg2

---------.

-- Smile text window button....


to gProcs()
tell application "Finder" to ,
set procs to (every process whose file type = "APPL")'s name as list
return procs & "Finder"
end gProcs

on mouseUp(theButton)
set w to container of theButton
choose from list gProcs()
if result = false then
error number -128
else

tell application (result's item 1)
activate
display dialog "Position Cursor and Press Enter" buttons
{"Cancel", "OK"} default button 2 with icon -19133
end tell
if button returned of result is "OK" then
set {x, y} to mouse location
set xy to "{" & x & ", " & y & "}"
end if

tell application "Smile"
activate
set w's selection to xy
end tell
end if
end mouseUp

--FWIW you can do point and click / keystroke stuff with Akua's 'input
state'
_____________________________ Andy
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Script the UNSCRIPTABLE
  • Next by Date: Re: Coercing a long point
  • Previous by thread: Re: Script the UNSCRIPTABLE
  • Next by thread: OT: replying to messages in Mail.app
  • Index(es):
    • Date
    • Thread