Which macro is faster?

who takes more time to compile and start the executable codes :
Execute AppleScript or execute two separate input actions ?


I don't think the KM model itself involves any compilation to an executable – and AppleScript is not, in any case, a compiled language – in the last analysis it all boils down (if I have understood correctly) to shell scripts (which may or may not involve some calls to existing executable code).

If no speed difference is immediately or obviously detectable to you, then are you sure that it really makes any difference ?

2 Likes

I use this nice set of macros to time KBM macros execution.

1 Like

The only noticeable difference I have seen in cases like this is AppleScript text actions versus AppleScript file actions. In other words, having the AppleScript embedded directly into the KM action versus having it saved as a scpt file and calling that file via the KM action. So I almost always use scpt files because 1) they’re generally faster (in my testing anyway), and 2) it keeps the macro size smaller since the code is stored outside of KM. The only exceptions to this is for very short AppleScripts that aren’t worth saving to a file, generally 5 lines or less.

yes, I think of the same thing.
so the conclusion is that such short AppleScript isn't convenient as those two ready actions !

Thanks bro !

I’d say that if you don’t know AppleScript (and many people do not) then KM has a simple way for you to achieve the same result without resorting to AppleScript.

Yes, I know some AppleScript.
Like cdthomer said, it's faster if you have more scripts to do. it becomes not as convenient as KM actions or almost the same speed compare to MK actions with just a few lines.
well, thank you too !