• 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
Is option key down?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is option key down?


  • Subject: Is option key down?
  • From: Robert Poland <email@hidden>
  • Date: Thu, 3 Sep 2009 15:20:38 -0600

Hi,

I've been using this and variations for some time.

my optionKeyDowntest()
set optionKeyDown to result

on optionKeyDowntest()
try
tell application "System Events"
if not ((some process whose name contains "KeyboardViewerServer.app") exists) then
tell application "KeyboardViewerServer.app" to activate
end if
end tell
on error
try
tell application "KeyboardViewerServer.app" to activate
on error
return false
end try
end try
tell application "System Events"
return (get value of checkbox "⌥" of window 1 of application process "KeyboardViewerServer.app") as boolean
end tell
end optionKeyDowntest


Now, since Apple (Snow Leopard) has done away with(?) KeyboardViewerServer.app it no longer works.

Does anyone have another way to tell if the option key, etc is down?


Bob Poland - Fort Collins, CO



_______________________________________________
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
  • Prev by Date: Re: date/Snow Leopard changed
  • Next by Date: Lists and writing to file
  • Previous by thread: Re: Snow Leopard and my randsig script
  • Next by thread: Lists and writing to file
  • Index(es):
    • Date
    • Thread