Mzigaib Posted August 8, 2018 Share Posted August 8, 2018 (edited) I am not succeeding in make this script work on a button with a callback script: if ( `run("message -b Delete,Cancel -d 0 Are you sure?")`==0),`run('message deleted')` ,`message('message canceled')` ) What am I doing wrong? Any tips? Edited August 8, 2018 by Mzigaib Misspell Quote Link to comment Share on other sites More sharing options...
vtrvtr Posted August 8, 2018 Share Posted August 8, 2018 Do you need to make it hscript? If not, the python equivalent would be something like On PythonModule define a function: def displayMessage(kwargs): hou.ui.displayMessage("Are you sure?", ("Delete", "Cancel")) And then on the Callback Script field you can write `hou.phm().displayMessage(kwargs)` and that's it. Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted August 8, 2018 Author Share Posted August 8, 2018 I am used to do everything in hscript but in this case I couldn't make it work also because I am trying to do the code it in just on line where where the callback script is limited to and I didn't want to write a function so I would prefer to do it in hscript though I know that using python would be welcome. Quote Link to comment Share on other sites More sharing options...
3dome Posted August 9, 2018 Share Posted August 9, 2018 (edited) the callback itself works fine for me. only thing is it always returns "deleted" even if i hit cancel. I usually do stuff like that with python so I can't help you with that, sorry Edited August 9, 2018 by 3dome Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted August 9, 2018 Author Share Posted August 9, 2018 Yeah the same for me, thanks for the help anyway. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.