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

    Yet Another WebDialog Gotcha

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 162 Views 2 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.
    • M Offline
      MartinRinehart
      last edited by

      Ruby handles text files correctly on both Windows and Mac. The line separator is the newline character (10, '\n'), regardless of platform.

      This does not extend to text retrieved from a WebDialog textarea widget, which will be delimited with newlines on a Mac, with return/newline pairs on a PC. This little bit of extra code is needed:

      text = web_dialog.get_element_value( 'textarea_id' ) text.gsub!( /\r\n/, "\n" ) # needed extra!

      Thank Todd Burch for his Mac support.

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • J Offline
        jessejames
        last edited by

        @martinrinehart said:

        Yet Another WebDialog Gotcha

        Seems to be annogolous with...

        @unknownuser said:

        Yet another Microsoft Windows Bug

        ...yes web dialogs are quite the cruel irony of SketchUp i would say. We sure could use a good ol built-in GUI about now.

        Always sleep with a loaded gun under your pillow!

        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