sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Script Problem - HTML

    Scheduled Pinned Locked Moved Developers' Forum
    12 Posts 5 Posters 413 Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Physicsguy1
      last edited by

      dlg = UI;;WebDialog.new("Unit Inspector", true,
      "ShowUI", 739, 641, 150, 150, true)
      dlg.set_html ('<b>What?</b>')
      dlg.show
      

      I can't get the HTML to work correctly. Ive tried it without the quotations, but I get this error: 'Unterminated strings meets end of file'
      i'm not sure what I'm doing wrong.

      1 Reply Last reply Reply Quote 0
      • chrisglasierC Offline
        chrisglasier
        last edited by

        It seems it will only show what's between the quotes - it is html syntax but it it won't make it bold.

        But anyway if you want control I suggest you make a proper html file and open that in the web dialog. You can then do just about anything!

        Chris

        With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

        1 Reply Last reply Reply Quote 0
        • P Offline
          Physicsguy1
          last edited by

          Other things don't work either 😞. I can't figure out what my error is...

          1 Reply Last reply Reply Quote 0
          • chrisglasierC Offline
            chrisglasier
            last edited by

            I don't think anyone can help unless you are specific.

            But as general advice, what is ruby do with ruby, what is html do with html. For example try to avoid writing html with ruby. Then all you have to worry about is making the link - and generally that is pretty straightforward.

            With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              I second the previous replies.

              An HTML file needs a header and footer. It could work without it, but the results are unpredictable. To get reliable result, you must make a properly formatted result - especially if you try to make it work cross platform. As the Internet engine will not recover from malformed markup as the Safari engine does.

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • fredo6F Offline
                fredo6
                last edited by

                @unknownuser said:

                dlg = UI;;WebDialog.new("Unit Inspector", true,
                > "ShowUI", 739, 641, 150, 150, true)
                > dlg.set_html ('<b>What?</b>')
                > dlg.show
                

                I can't get the HTML to work correctly. Ive tried it without the quotations, but I get this error: 'Unterminated strings meets end of file'
                i'm not sure what I'm doing wrong.

                The minimum is to put a HTML tag. Keep in mind that it is the browser interpreting the code, not Ruby.
                So try instead:

                dlg.set_html "<HTML><b>What?</b></HTML>"

                1 Reply Last reply Reply Quote 0
                • P Offline
                  Physicsguy1
                  last edited by

                  Thank you. Now here we go again...

                  I've noticed some HTML-based input boxes. I know how to create them, but I don't know how to associate the text in the box with a ruby variable. How would I do this?

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    http://code.google.com/apis/sketchup/docs/ourdoc/webdialog.html#add_action_callback

                    Use the add_action_callback method and call a function that sets the arguments to the variables.

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • chrisglasierC Offline
                      chrisglasier
                      last edited by

                      I was pointed to a very good article in sketchupapi.blogspot when I first started to look at web dialogs. It is called "Passing variables .... " or something like that. Try to find it otherwise I'm afraid you will go from pillar to post and end up (wrongly) decrying web dialogs.

                      With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                      1 Reply Last reply Reply Quote 0
                      • Chris FullmerC Offline
                        Chris Fullmer
                        last edited by

                        I'm not sure what one you are thinking of Chris, but this article talks about web dialogs:

                        Link Preview Image
                        Sharing data between SketchUp Ruby and Javascript

                        Posted by Scott Lininger, SketchUp Software Engineer If you are building rich WebDialogs in your SketchUp Plugin, then you are probably usin...

                        favicon

                        (sketchupapi.blogspot.com)

                        I have read it many times, and I still don't quite get some of it. I am discovering I need to rad up on HTML. Its more involved than I ever realized 😄

                        Chris

                        Lately you've been tan, suspicious for the winter.
                        All my Plugins I've written

                        1 Reply Last reply Reply Quote 0
                        • Chris FullmerC Offline
                          Chris Fullmer
                          last edited by

                          Oh, and also this little post here, which was the one right before the one I linked to above. I guess Scott had web dialogs on his mind back then.

                          Link Preview Image
                          WebDialog

                          Posted by Sang Ahn, SketchUp Software Engineer One of the interesting features of SketchUp's Ruby API is the UI::WebDialog class. Since ...

                          favicon

                          (sketchupapi.blogspot.com)

                          Chris

                          Lately you've been tan, suspicious for the winter.
                          All my Plugins I've written

                          1 Reply Last reply Reply Quote 0
                          • chrisglasierC Offline
                            chrisglasier
                            last edited by

                            @chris fullmer said:

                            I'm not sure what one you are thinking of Chris, but this article talks about web dialogs:

                            The trouble you see is that I cannot open anything with blog in it (nor you or tube) but the date seems right. Perhaps the other other Chris will let us know if it is useful. As you know I am very keen to interest more people in web dialogs, because, for example, I agree with this chap.

                            @unknownuser said:

                            Vic Gundotra, Google Engineering vice president and developer evangelist, told the Mobilebeat conference in San Francisco on Thursday that the web had won and users of mobile phones would get their information and entertainment from browsers in future.

                            ...

                            “What we clearly see happening is a move to incredibly powerful browsers,” he said.

                            “Many, many applications can be delivered through the browser and what that does for our costs is stunning.

                            “We believe the web has won and over the next several years, the browser, for economic reasons almost, will become the platform that matters and certainly that’s where Google is investing.”

                            With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            Buy SketchPlus
                            Buy SUbD
                            Buy WrapR
                            Buy eBook
                            Buy Modelur
                            Buy Vertex Tools
                            Buy SketchCuisine
                            Buy FormFonts

                            Advertisement