• 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: How can I use "if keyboard.OptionKey is down then" ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I use "if keyboard.OptionKey is down then" ?


  • Subject: Re: How can I use "if keyboard.OptionKey is down then" ?
  • From: "J. Stewart" <email@hidden>
  • Date: Sun, 7 Oct 2007 07:02:59 -0400

On 10/6/07 at 3:53 PM, Emile Schwarz <email@hidden> spake thusly:

I want to have the ability to make a default selection and an optional selection.

The default selection is actually "use the Finder front window", the optional selection would be "ask the user for a target folder".

The problem I have is to make the differentiation at AppleScript run time. In another language I use, I check the fn key at image file drop and fill the window with a reduced (or expanded) copy of the image.

What I want to do here with AppleScript is something like:

if the Option Key is down then
ask the user to choose a folder -- set Source_Folder to choose folder

else
set Source_Folder to target of front window as alias
end if


How can I wrote the "if the Option Key is down then" part ?

Please, do not tell me to use display dialog as the original code (an AppleScript source example)
has.


I suspect from your text that what you are looking for is the Jon's Commands.osax which you can find here - <http://www.seanet.com/~jonpugh/>. You'll want the Jon's Commands X 3.0d3 version.

--> Cut <--
if (keys pressed) contains "Option" then
	say "The Option key was pressed"
else
	say "The Option key was not pressed"
end if
--> Cut <--
--
An elephant is a mouse built to government specifications.
_______________________________________________
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
References: 
 >How can I use "if keyboard.OptionKey is down then" ? (From: Emile Schwarz <email@hidden>)

  • Prev by Date: Re: Scripting InDesign Tables
  • Next by Date: Trouble with Remote Apple Events (eppc) and Keychain
  • Previous by thread: How can I use "if keyboard.OptionKey is down then" ?
  • Next by thread: Creating shapes in Illustrator
  • Index(es):
    • Date
    • Thread