Alt, CMD, Ctrl or Shift key pressed

Hi,

I think you can cut out the do shell script by running the python script. You might need to upgrade your python setup with a download. I can’t remember what it was.

Edited: just remembered that you can run a unix python script.

Edited: also, you can check for all the modifier keys in one python script. So, you don’t need to check for each on individually.

Edited: I didn’t get why you couldn’t use Shane’s Script Library script. That should be quick.

Edited: maybe you can place an alias to the library script in the user’s Script Library. I don’t know if it would work. Still checking on these ideas.

Edited: too many ideas and not enough time. Just thought of another idea. A pepper scented car cover to keep the cats off the truck. Hope someone can help you.

Later and glGood Luck,
kel

Hi all

Hope Shane will send me a tester so I can test the script myself, I am to stupid to use/test his script because I am a VBA guy. Love to learn from you all but sometimes my head is spinning, I am sure you have that also with some VBA code.

I add this page today with a VBA example based on DJ’s script
http://www.rondebruin.nl/mac/mac031.htm

I hope with the help of you all I can add a second example that is maybe faster

Thanks

The do shell script is actually not the problem, it’s initializing the PyObjC bridge that is causing the delay. So calling directly Python or not doesn’t make much difference.

For the command the entire AppKit module is loaded which needs some time to setup (Python has an init script for a module inside a package) including a file containing 10K lines. The file contains constants, enums, constant strings and additional methods to existing cocoa classes, including the enum NSControlKeyMask = 262144.

Initially Ron was clearly looking for a solution that he can simply copy and paste into VBA’s MacScript function without any external resources needed. The MacScript function in VBA also accepts script files as it’s argument which I think Ron is trying to use now.

My personal objection would be that globally (according to statistics in July 2014) still only 62% of all macs are Mavericks. The second largest group is still Snow Leopard and not even Lion or Mountain Lion. I can see for myself that Snow Leopard is much used because some world leading multi billion dollar companies as my clients (with tens of thousands of work stations world wide), are for 90% still working on Snow Leopard. I had to downgraded some of my own machines back to Mountain Lion because Mavericks is one of the worse releases when it comes to stability. I think therefore a Mavericks only solution is narrowing down your audience, something you don’t want on a tutor site.

FWIW, ASObjC also has to load the .bridgesupport file. That does take time – but not much, and only once per process.

I agree with your conclusion, if not your polemic ;).

But if there is a problem with the time it takes for the Python one to load, and if it is considerably quicker using a Script Library (and I have no idea if that’s the case), I’m not sure that the idea of hosting two versions, one marked Mavericks-only, would be such an outrageous idea. Penalising users in the name of a common denominator seems a bit short-sighted to me.

But what would I know. Mavericks here is every bit as stable as Mountain Lion ever was, and a lot more sensible than Lion.

Totally agree. When someone has a newer system, the user should make use of the benefits.

I do believe that. It’s the backward compatibility that is my issue in Mavericks and gets me frustrated. Of course I would be lying if I said that I would have no crashes at all in ML, when it happens once or twice a day I can live with that.

Hi all

Thanks all for this very useful thread
I add an example that use a script bundle file to get the same speed as that the API in Windows thanks to Shane.

See example 2 on this page
http://www.rondebruin.nl/mac/mac031.htm

For VBA users is this page useful I think with the two examples based on DJ’s and Shane’s ideas

Thanks and have a great weekend