SCaldeira Posted October 1, 2011 Share Posted October 1, 2011 Dear friends. If I write in lisp (Command (alert "Hi Bob")), a message box will appear with a OK button. How can I write in Lisp to click that button, without the mouse click or without pressing enter? Thank you for your help. With the Best regards. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 1, 2011 Share Posted October 1, 2011 I don't understand why you would use (alert ) to display an alert box, only to dismiss it programmatically? I don't think this is possible though, since the alert box takes focus until dismissed by the user, and multi-threading is not possible in AutoLISP. Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 2, 2011 Share Posted October 2, 2011 DosLib required... (dos_traywnd "" "Hello World!" 360 100 "" 1500) Quote Link to comment Share on other sites More sharing options...
SCaldeira Posted October 2, 2011 Author Share Posted October 2, 2011 See the attached file. Example.pdf Greetings. I don't understand why you would use (alert ) to display an alert box, only to dismiss it programmatically? I don't think this is possible though, since the alert box takes focus until dismissed by the user, and multi-threading is not possible in AutoLISP. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 4, 2011 Share Posted October 4, 2011 Are you doing a wblock ? try -wblock it helps a bit with filedia = 0 you need also a Alt+N keystroke for the No ALt+Y for Y this can be done pretty sure as an extend key just like the Alt text characters. Search here for ALT keys probably in lisp section may get you around user input. Any one help ALT+.... Quote Link to comment Share on other sites More sharing options...
irneb Posted October 4, 2011 Share Posted October 4, 2011 (edited) BIGAL, you mean through the VBScript's SendKeys? Something like this: (setq ws (vlax-get-or-create-object "WScript.Shell")) (vlax-invoke ws 'SendKeys "%Y") (vlax-release-object ws) Edit: Fixed a small bug in my code. Sorry. Even that's not going to work. Since lisp either sends the keys before opening alert, or only after alert's closed. So it doesn't help. Another alternative is to start the alert by sending the keys: (progn (setq ws (vlax-get-or-create-object "WScript.Shell")) (vlax-invoke ws 'SendKeys "{(}alert \"Test\"{)}~") (vlax-invoke ws 'SendKeys "~") (vlax-release-object ws) ) And yet that doesn't work either, since it's waiting for the alert to close before sending the next Enter. Even sending the 2nd enter in the same SendKey call does the same. So unfortunately your only option would be to modify that C:Carto defun not to display the alert boxes. Edited October 4, 2011 by irneb Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 4, 2011 Share Posted October 4, 2011 And yet that doesn't work either, since it's waiting for the alert to close before sending the next Enter. Even sending the 2nd enter in the same SendKey call does the same. I don't think this is possible though, since the alert box takes focus until dismissed by the user, and multi-threading is not possible in AutoLISP. I too investigated the SendKeys method for this... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 6, 2011 Share Posted October 6, 2011 Maybe back to my question what command are you using to invoke the "map info y or N" maybe this can be called differently so it does not appear. 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.