MACRO: Choose File From Folder List With Incremental-Search and AutoComplete

Chris @ccstone, my apologies. I had the Bash find command on my brain since I had just finished working with a macro that used it. So my reply was about the find command. My reply to you was inappropriate.

Thanks for pointing this out. I have devised a simple solution, and have updated my above Macro.
Since the user is presented with a list of files, I don't think that would have been an issue, but it is still best to exclude them.

You don't post the elapsed time for your script, so I don't know how long it takes.
But my script returns 872 files in 0.33 sec -- seems fast enough to me.
In most cases I would think the user would have much fewer than 500 files, probably less than 100.

Just uploaded revised version.

I did post the elapsed times for the AppleScripts along with the code.

The shell script on the other hand takes ~ 0.072 seconds to process 1000 files even on my old hardware.

-Chris

Chris, I can confirm the much better performance of the shellscript. I have to admit it was hard to believe at first.

ShellScript in KM

image

It would seem that most of the performance advantage of the shellscript comes from the way the KM executes an AppleScript. When I run my Get Files script in Script Geek app, it takes only 0.093 sec, whereas it takes 0.33 sec when run from KM, an increase of 0.237 sec:

Script Geek

image

As we have seen in previous tests, KM adds ~0.20 to 0.25 sec to the execution of an AppleScript.

@peternlewis, I'm sure this will not change your mind about changing how KM executes AppleScripts, but you should be aware of this performance hit.

1 Like