How detect a key pressed during a drop for a droplet?

I have a drag and drop applescript application and during the “drop” I want detect if a modifier key or even a normal key is pressed.

The best would be to detect during the “on drop” but if the solution need let the full open that’s ok.

If the solution need a “call method” command that isn’t too complex to make work, that’s fine too.

You can try Jon’s Commands’ keys pressed command, which will return a list of pressed keys (as the same name implies :lol: )
http://www.seanet.com/~jonpugh/

Thank you very much I go try what it is.

So the Jon additions keys pressed works fine but that’s a bit embarassing to ask the user install it. So I did some objective c functions (what a pain!!) and used call method that works fine.

Now I have different questions :
About Applescript additions :

  • Can I just embedded them in my app and use them? I tried and seach without success.
  • The only place I found to make them working was to put them in /Library/ScriptingAdditions. Is tht normal? Can’t I put them in a user path like ~/Library/ScriptingAdditions?

About using call method:

  • I got something boring. I wanted a function returning a boolean. And tried many options including the (BOOL) in the example of the doc but always get a sort of int sometimes just 0 or 1 sometimes an int but never true/false in Applescript. Ok I can do with that but it’s not cool.
    Any idea?
  • As I couldn’t do something as sophisticate than the Jon’s keys pressed, I wanted make something based on mask. But those are values in .h. How manage that in Applescript?

Yes, you can put Scripting Additions in each users home Library. If the ScriptingAdditions folder is not there, you’ll to make a new folder and name it “ScriptingAdditions”. Placing Sctipting Additions in the root Library (/Library/ScriptingAdditions/) makes them available for all users, placing them in the (~/Library/ScriptingAdditions/) makes them available for individual users.

Dam really? Omg I was sure to have tried this path ^_^. I go try thanks.

Arg there was a blank at the end of the name. :slight_smile: