I've noticed that when using a script trigger, alfred will evaluate the entire script from the first character typed in an argument, but the user can continue to type and the script will keep reevaluating.
However, I'm trying to build in functionality so that, if on the first keystroke the script will run for a long time, subsequent instances of the script will skip the long processing steps, at least until the initial processing is complete.
I've implemented it like so:
Check if long_process needs to run, based on a flag in a plist file If long_process needs to run, set the flag in the plist and start long_process once long_process is complete, clear the flag
If long_process doesn't need to run, start short_process (to provide feedback to user)
However this doesn't work. It appears that short_process will never run, despite multiple keystrokes being entered. How can I make it work, or at least somehow run the long process on a different thread?