No internet connection
  1. Home
  2. How to

Wait for specific key press only

By Moises Garcia @Moises_Garcia
    2022-02-22 04:22:46.455Z

    Hi there,

    I've recently started using SF and have been trying to mimic most of my KM macros on SF.
    I was wondering if it's possible to somehow add a "Pause Until Condition is Met" action and the condition is a keyboard press of "Return".

    What I'm doing is making a macro that adds comments to a selected file on the Finder window and then closing the "Get info" window after I press "Return" on the keyboard once I finish adding the comment. Currently I have the macro open up the "Get info" window and tab down to the comments section. KM has the "Pause until condition is met" and stating the condition to be "Return" which will then close the "Get info" window. Does SF have something like this or is there another way for me to accomplish this?

    Thanks!

    • 2 replies
    1. Hi Moises,

      Usually, the way we do these things in SoundFlow is a bit different.

      Generally, the ideal order of execution for a macro is:

      • Get all user input first, for example open up a text input / prompt to ask the user which comment they'd like to add
      • Execute the automated steps

      By making sure all user input is received at the beginning of the script, a larger portion of the script can run unsupervised, which will mean a more effective workflow.

      So, any time you have a script that will ask for user input during its execution, think about if you can move that user input to the beginning of the script - that is generally a better solution.

      In your case, you could start by using a prompt call to get the user input into a variable, and then use that variable later in your script. It'll be easier to help you with that part if you share the current code or macro steps you have. The best way to share that is to use the "Need help" button on the macro or script, as it will automatically create a forum post for you with the script or macro already embedded into the forum post, so that it's easy for us to help :)

      1. MMoises Garcia @Moises_Garcia
          2022-02-23 03:40:04.936Z

          Hi Christian!

          Thanks for the info, just did the "Need Help" button on the macro and added more info about it. It can be found here: Possible wait for specific key press only?

          As for your suggestion on trying to use a prompt call to get user input into a variable, I'm not too keen on most of the code that is being used on here which I most definitely want to get into going forward now, but if I'm understanding correctly would your prompt call still work if the comments that will be added to the "Get info" window be unique?

          Thanks again!