• 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
How do I write "If option key is down then" in AppleScript ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I write "If option key is down then" in AppleScript ?


  • Subject: How do I write "If option key is down then" in AppleScript ?
  • From: Emile Schwarz <email@hidden>
  • Date: Thu, 25 Mar 2010 15:06:24 +0100

Hi all,

the subject nearly says all.

I want to execute a piece of code when the option key is down and a different one otherwise.

The nearest code I was able to find was:

tell application "Finder"
	set fw to front window

	choose from list {"Option 1", "Option 2"}
	if the result is "Option 1" then
		set bounds of fw to {0, 44, 580, 280}

	else if the result is "Option 2" then
		set bounds of fw to {0, 44, 740, 670}
	end if

	-- End of code
end tell


In another development environment, I am able to use (pseudo code):

If option key is down Then
	code for this case
Else
	code for this case
End If

So I am asking myself (and this list) if there is a different way to code what I want to achieve...

TIA,

Emile
_______________________________________________
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
  • Follow-Ups:
    • Re: How do I write "If option key is down then" in AppleScript ?
      • From: Laine Lee <email@hidden>
    • Re: How do I write "If option key is down then" in AppleScript ?
      • From: Robert Poland <email@hidden>
  • Prev by Date: Re: Sort folder list descending
  • Next by Date: Re: How do I write "If option key is down then" in AppleScript ?
  • Previous by thread: Re: old script fails AND BUG in Smile 3.5.2 (build 609)
  • Next by thread: Re: How do I write "If option key is down then" in AppleScript ?
  • Index(es):
    • Date
    • Thread