<div dir="ltr">I'm thinking that, as long as I'm fixing it, maybe I should just go ahead and return the actual return value from the script in the second parameter. Shouldn't be too hard.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 22, 2022 at 11:40 AM Jan Angermüller <<a href="mailto:jan@angermueller.com">jan@angermueller.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
No problem, Robert. <br>
Great that you have found it! <br>
<br>
<br>
<div>Am 22.12.2022 um 18:30 schrieb Robert
Patterson:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Whoops, there's a bug. Sorry. I can fix it for the
next version, but I don't see any way to do what you want right
now.<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Dec 22, 2022 at 11:16
AM Jan Angermüller <<a href="mailto:jan@angermueller.com" target="_blank">jan@angermueller.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div> Robert,<br>
<br>
your suggestion is exactly the code that I tried before I
wrote the first message in this thread.<br>
I tried:<br>
<i>return tostring(false) </i><br>
<i>return false</i><i><br>
</i><i>return "Cancel"</i><br>
<br>
When I do this<br>
<i>local success, msg = finenv.ExecuteLuaScriptItem(item)</i><i><br>
</i>gets me:<br>
success == true<br>
msg == nil<br>
<br>
I only get <i>success==false </i>with<i> error(...)</i><br>
(tested on Windows/Fin27/RGP Lua 0.65 only)<br>
<br>
Jan<br>
<br>
<div>Am 22.12.2022 um 18:04 schrieb Robert Patterson:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>It looks like the code always shows the error
message. :-/</div>
<div><br>
</div>
<div>For your purposes, I think the best choice might be
simply to return a message. Or just return
tostring(false) and then compare the string returned
to that, if you don't care about the message.<br>
</div>
<div><br>
</div>
<div>Something like:</div>
<div><br>
</div>
<div>local success, msg =
finenv.ExecuteLuaScriptItem(item)</div>
<div>if success and msg then
<do-error-return-code> end</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Dec 22, 2022
at 10:47 AM Jan Angermüller <<a href="mailto:jan@angermueller.com" target="_blank">jan@angermueller.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div> Hm, I still didn't succeed.<br>
<br>
When I throw an error message in a lua script with:<br>
<i>error("Cancel",2)</i><br>
then this a user dialog always pops up in RGP
Lua/Windows:<br>
<img src="cid:1853aee0547cda4009f1" alt=""><br>
<br>
Is there a way to not show this dialog in RGP Lua?<br>
(Tested in Fin27.2/Windows 10/RGP Lua 0.65)<br>
<br>
This happens without<i> finenv.ExecuteLuaScriptItem</i>
, it's just the <i>error(...) </i>that leads to
the popup.<i><br>
</i><br>
The same code in JW Lua doesn't give a dialog that
pops up.<br>
<br>
Or does anyone have an example code of how to end a
lua script so that it passes a "not successful" to <i>finenv.ExecuteLuaScriptItem
</i>without showing any error messages.<br>
<br>
Jan<br>
<br>
<br>
<br>
<div>Am 20.12.2022 um 01:27 schrieb Robert
Patterson:<br>
</div>
<blockquote type="cite">
<div dir="ltr">As far as I can tell,
ExecuteLuaScriptItem is working as <a href="https://www.finalelua.com/docs/rgp-lua/finenv-properties#executeluascriptitem-function" target="_blank">documented</a>.
It is not the same behavior as a command line
tool. As for the 'error' function, it will close
the Lua state of the called script, but that
would appear to be what you want anyway.
Otherwise you can return a string that will be
returned in the second return value of
ExecuteLuaScriptItem.<br>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
JWLua mailing list
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Jan Angermüller
Orchideenstieg 13
22297 Hamburg
Tel. 040 - 28 94 84 82
Mobil 0173 - 99 33 904
<a href="http://www.elbsound.studio" target="_blank">www.elbsound.studio</a></pre>
</div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
JWLua mailing list
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Jan Angermüller
Orchideenstieg 13
22297 Hamburg
Tel. 040 - 28 94 84 82
Mobil 0173 - 99 33 904
<a href="http://www.elbsound.studio" target="_blank">www.elbsound.studio</a></pre>
</div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
JWLua mailing list
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Jan Angermüller
Orchideenstieg 13
22297 Hamburg
Tel. 040 - 28 94 84 82
Mobil 0173 - 99 33 904
<a href="http://www.elbsound.studio" target="_blank">www.elbsound.studio</a></pre>
</div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>