Problem loading file

I created a new file in my Plugins folder and when I try to open it I get this error message:
could you help me?

you need the full path. so try something like…

load "#{Sketchup.find_support_file('/r/hwl.rb', 'Plugins')}"

john
edit: fixed typo…

1 Like

I tested here is the result. :
load “#{Sketchup.find_support_file(‘/r/hwl.rb’. ‘Plugins’)}”
Error: #<SyntaxError: : syntax error, unexpected tSTRING_BEG, expecting ‘(’
load “#{Sketchup.find_support_file(‘/r/hwl.rb’. ‘Plugins’)}”
** ^**
: syntax error, unexpected ‘)’, expecting tSTRING_DEND
load “#{Sketchup.find_support_file(‘/r/hwl.rb’. ‘Plugins’)}”
** ^**
: unterminated string meets end of file>
SketchUp:1:in `eval’
:confused:

Typo in John’s example. That needs to be a comma between the two arguments to find_support_file.

cheers Steve, @szabochristophe69 I did say [quote]
something like…
[/quote]

I wasn’t sure if you needed the ‘/r/hwl.rb’ or just a plain ‘r/hwl.rb’

personally I usually just type load " " and drag the file into the braces…

john

If the file is in a folder which is listed in the $: - typically your users Plugins folder - then load ‘hwl.rb’ will work.
If the file is in a subfolder [say named ‘r’] within a folder listed in the $: then - load ‘r/hwl.rb’ will work.
If the file is not within any of the $: folder-paths, then you need to pass the full path to it, e.g.
load ‘C:/Users/Myname/Desktop/MyTesting/r/hwl.rb’
Obviously if there are significant errors in the Ruby code in this file, in any of these locations, it will not load successfully.

2 Likes