sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Install script options- help needed

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 2 Posters 340 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.
    • garydornG Offline
      garydorn
      last edited by

      in SU ruby online help, it says ruby scripts can be installed a number of ways
      http://download.sketchup.com/OnlineDoc/gsu6_ruby/Docs/examples.html

      I am trying to setup mine as per the
      "Automatically Loading a Ruby Script Using the "require_all" Function"

      I am on mac OS 10.5.5

      I've made a myRubyScripts.rb file with
      home = File.expand_path "~"
      myrubyscripts = File.join home, "MyRubyScripts"
      require_all( myrubyscriptsdirectory )

      which I then placed in the SU plugins folder

      and a folder myrubyscriptsdirectory, which I then placed in in my user account and added a test plugin ; ContourMaker.rb

      when I start up SU I get this error message
      Error Loading File myrubyscripts.rb
      /Library/Application Support/Google SketchUp 6/SketchUp/Plugins/myrubyscripts.rb:1: parse error, unexpected $undefined., expecting '}'
      {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf420
      ^

      what have I done wrong.
      thanks

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

        Save your "myRubyScripts.rb" file as plain (ascii) text, not as Rich Text.

        Hi

        1 Reply Last reply Reply Quote 0
        • garydornG Offline
          garydorn
          last edited by

          according to Get info , the file is is plain text
          screen shot attached

          http://img383.imageshack.us/img383/6724/myrubyscriptsni6.th.png

          http://img383.imageshack.us/images/thpix.gif

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

            garydorn,

            Welcome to the forum, by the way...

            {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf420
            

            Not being a Mac user, it's hard for me to say. It does appear to be a plain text file, but the code above (from your post) is the header information for a Rich Text Format file.

            Hi

            1 Reply Last reply Reply Quote 0
            • garydornG Offline
              garydorn
              last edited by

              thanks,
              I understand what you say, so I deleted that file, duplicated the utilities.rb file and replaced its text with the text suggested, then changed the file name to myrubyscripts and then opened SU
              I get this now

              Error Loading File MyRubyScripts.rb
              undefined local variable or method `myrubyscriptsdirectory' for main:Object

              thanks
              Gary

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

                Because myrubyscriptsdirectory is an undefined local variable or method. πŸ˜„

                You set the variable named myrubyscripts in the previous line...

                Hi

                1 Reply Last reply Reply Quote 0
                • garydornG Offline
                  garydorn
                  last edited by

                  I understand what you say about the text not matching so I played round with changing them so they matched, and after non-working numerous iterations,
                  it finally worked!

                  its now

                  home = File.expand_path "~"
                  myrubyscripts = File.join home, "MyRubyScripts"
                  require_all(myrubyscripts)

                  I think it worked because I eventually removed the spaces around (myrubyscripts)?

                  thanks for your help Jim

                  may this be of assistance to other Mac users.

                  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