Show_prompt() return: "may be busy or may have stopped responding"

R3.2.0 W10. I am using a function whose fragment is as follows:

  local function custom_prompt()
    local mpt=rna:show_prompt(
      ("PRE: %s"):format(phm_tool_name),
      ("%s\nDo you really want to continue?"):format(string_names),
      {"Proceed","Cancel","Open Folder Only"}
    if (mpt=="Cancel") then
    elseif (mpt=="Open Folder Only") then
      if not io.exists(path) then
      --more & more code

The pop-up window of this show_prompt() are this aspect:
With 3 buttons: [Proceed] [Cancel] [Open Folder Only]

I think I am using the code correctly. But when this pop-up window appears and I wait a few seconds, after I press the “Cancel” button, the following window appears:


The temporar sequence is this:

  1. I invoke the popup window “PRE: Phrase Manager”.
  2. I wait a few moments, 10, 15 seconds or more. The time it takes to read the contents of the window.
  3. I press the “Cancel” button (the “return” order should be executed inside the code).
  4. Then the warning window appears “Script not responding”.

I don’t understand why it crashes with the message: “may be busy or may have stopped responding”.

Is the code that I have built wrong or is there a flaw in the API?

I understand that, if you want to stop the script, it is necessary to put “return”. The Cancel button has a “return”. Even so, the “Script not responding” window appears.

Does anyone know exactly what is happening? I think I have no control over this.

Did you verify it has anything to do with the popup window? Have the terminal open and use print statements from your script to track down exactly where your script halts/loops.

Your snippet alone doesn’t seem to cause the non-responsiveness. The most common thing is 1) a never-ending loop, 2) heavy operations like swapping lots of stuff, editing lots of pattern data, loading/saving lots of files. I’d guess 1 in this case.

Thanks @joule! I did some tests with impressions, but I could not detect the problem.

However, I saved the tool and loaded it in version 3.2.1b1, and it did not happen again.

Probably, while I am in the “trial and error” period when programming, something stays in the background. I am aware of the functions I build. So it has been something strange that has not happened to me again. At least for now.

So, since I don’t know what happened, I’m going to ignore the issue…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.