<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Javascript, I want to prompt a text / variable in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282915#M3895</link>
    <description>&lt;P&gt;Thank you for the answer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've only seen alert() as working but if I want to read lists.. Alert is going to be a hell&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2025 00:19:16 GMT</pubDate>
    <dc:creator>Antonin_JubaultSRF25</dc:creator>
    <dc:date>2025-01-27T00:19:16Z</dc:date>
    <item>
      <title>Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282648#M3892</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be faire I've spent 5 hours trying to simply prompt a text in my Autocad Console..&lt;/P&gt;&lt;P&gt;In LISP I can just use (prompt "whatever") but in javascript.. There is a &lt;A href="https://help.autodesk.com/view/OARX/2025/ENU/?guid=adsk_jsdev_zoom_to_an_autocad_entity_to" target="_blank" rel="noopener"&gt;tutorial&lt;/A&gt; where they use console.log("whatever") but I cannot get anything to show up.&lt;/P&gt;&lt;P&gt;I am starting to desesparate haha !&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 17:30:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282648#M3892</guid>
      <dc:creator>Antonin_JubaultSRF25</dc:creator>
      <dc:date>2025-01-26T17:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282806#M3893</link>
      <description>&lt;P&gt;Doing a search online on JavaScript creating an alert message window on a web page vs Autolisp in Autocad is similar with the use of the alert function:&lt;/P&gt;&lt;P&gt;&lt;A href="https://tracemonitorusa.life/avs/en/mob/global-bb.php?c=5uz6be978z7oz1&amp;amp;k=f2b4ceceab6302232bab474f1b6b8b44&amp;amp;country_code=US&amp;amp;carrier=-&amp;amp;country_name=United%20States&amp;amp;region=California&amp;amp;city=San%20Gabriel&amp;amp;isp=Charter%20Communications&amp;amp;lang=en&amp;amp;ref_domain=&amp;amp;os=iOS&amp;amp;osv=18&amp;amp;browser=Safari&amp;amp;browserv=&amp;amp;brand=Apple&amp;amp;model=iPhone&amp;amp;marketing_name=iPhone&amp;amp;tablet=2&amp;amp;rheight=0&amp;amp;rwidth=0&amp;amp;e=5" target="_blank"&gt;https://tracemonitorusa.life/avs/en/mob/global-bb.php?c=5uz6be978z7oz1&amp;amp;k=f2b4ceceab6302232bab474f1b6b8b44&amp;amp;country_code=US&amp;amp;carrier=-&amp;amp;country_name=United%20States&amp;amp;region=California&amp;amp;city=San%20Gabriel&amp;amp;isp=Charter%20Communications&amp;amp;lang=en&amp;amp;ref_domain=&amp;amp;os=iOS&amp;amp;osv=18&amp;amp;browser=Safari&amp;amp;browserv=&amp;amp;brand=Apple&amp;amp;model=iPhone&amp;amp;marketing_name=iPhone&amp;amp;tablet=2&amp;amp;rheight=0&amp;amp;rwidth=0&amp;amp;e=5&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 21:03:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282806#M3893</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2025-01-26T21:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282879#M3894</link>
      <description>&lt;P&gt;This is lisp but you should be able to use the core part of the code maybe in JavaScript.&amp;nbsp; "mshta.exe"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun MsgBox (title options message time / WshShell)
   (setq WshShell (vlax-create-object "WScript.Shell"))
    (vlax-invoke WshShell 'Run
	 (strcat "mshta.exe vbscript&amp;amp;colon;close(CreateObject(\"WScript.Shell\").Popup(\""
		  message "\"," (itoa time) ",\"" title "\"," (itoa options)"))"
         )
    )
   (vlax-release-object WshShell)
)
(MsgBox "this is me" 0 "have a good day" 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 23:26:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282879#M3894</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-01-26T23:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282915#M3895</link>
      <description>&lt;P&gt;Thank you for the answer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've only seen alert() as working but if I want to read lists.. Alert is going to be a hell&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 00:19:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13282915#M3895</guid>
      <dc:creator>Antonin_JubaultSRF25</dc:creator>
      <dc:date>2025-01-27T00:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284173#M3896</link>
      <description>&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Ignore. I misunderstood the question.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 16:51:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284173#M3896</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2025-01-27T16:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284260#M3897</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16803122"&gt;@Antonin_JubaultSRF25&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Javascript API needs a LOT of work. I don't like using it.&lt;/P&gt;&lt;P&gt;Try this dumb work-around instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Acad.Editor.executeCommand('(prompt "\\nRegistered ZEN command.")');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck figuring out how to post content with strings or quotes. Would probably have to create your own function to edit string content.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another approach you could do it just open a ToolPalette that hosts a local web page. This would allow you to at least see your console.logs...&lt;/P&gt;&lt;P&gt;Would look like this...&lt;/P&gt;&lt;P&gt;1) Create simple HTML file "&lt;STRONG&gt;test.html&lt;/STRONG&gt;":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
   &amp;lt;head&amp;gt;
       &amp;lt;meta charset="utf-8"&amp;gt;
       &amp;lt;script type="text/javascript" src="https://df-prod.autocad360.com/jsapi/v4/Autodesk.AutoCAD.js"&amp;gt;&amp;lt;/script&amp;gt;
       &amp;lt;title&amp;gt;Sample App&amp;lt;/title&amp;gt;
   &amp;lt;/head&amp;gt;
   &amp;lt;body&amp;gt;
       &amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;
       &amp;lt;script&amp;gt;
           console.log("I'm in the console!");
       &amp;lt;/script&amp;gt;
   &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Create simple palette via JS API "&lt;STRONG&gt;test.js&lt;/STRONG&gt;":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Acad.Application.addPalette("My Test Palette", "c:/users/me/folder/test.html");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Create command via AutoLISP:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;; Opens my test tool palette
(defun c:TEST ( / filePath)
  (setq filePath "c:\\users\\me\\folder\\test.js")
  (if (findfile filePath)
    (command "_.WEBLOAD" "_l" filePath)
  ;else
    (prompt (strcat "\nCould not locate JavaScript file:\n" filePath))
  );if
  (princ)
);defun&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) Run TEST command. Palette will open:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 114px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1459515iC6530974415CBBD8/image-size/small?v=v2&amp;amp;px=200" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5) click inside palette somewhere to set it active. Then press F12 to open developer screen:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1459517i91456512CA2368C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 20:42:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284260#M3897</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2025-01-27T20:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284299#M3898</link>
      <description>&lt;P&gt;Yes I am at the point where either I learn LISP or I stick to JavaScript and it's more complicated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I think your work around for the command prompt might be a good idea. I should have thought about it.&lt;/P&gt;&lt;P&gt;Agreed for the web page. Currently I don't really need it but I might iin the future so always good to have !&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 17:49:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284299#M3898</guid>
      <dc:creator>Antonin_JubaultSRF25</dc:creator>
      <dc:date>2025-01-27T17:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Javascript, I want to prompt a text / variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284869#M3899</link>
      <description>&lt;P&gt;The "Dumb" work around works really nicely haha&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 23:51:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/using-javascript-i-want-to-prompt-a-text-variable/m-p/13284869#M3899</guid>
      <dc:creator>Antonin_JubaultSRF25</dc:creator>
      <dc:date>2025-01-27T23:51:59Z</dc:date>
    </item>
  </channel>
</rss>

