# Yet another SU Ruby question



## Steve Maskery (24 May 2006)

OK, so I'm sorting out the useful Ruby scripts from the rest, to try to reduce the size of my Context menu and Plugins list.

I have found that some of the entries in the lists do not seem to be in any of the scripts in the Plugins directory, nor even in the whole of the @Last directory. Clearly this cannot be the case, as they weren't there before I added all these scripts; nevertheless, a seach of my directory for "Copy along path", for example, finds nothing. There are others, too.

I have found that some of the rb scripts are readable ascii files, whilst others appear to have been compiled. They still seem to be ascii - I can edit them in Wordpad - but they are not readable in the normal sense. I suspect this is where these entries are. 

Does anyone know how to read these so I can edit out the unwanted stuff?

TVM
Steve

PS As an aside, does anyone know why it takes Microsoft half an hour to seach my little PC whilst Google can seach the entire planet in a millisecond?


----------



## SketchUp Guru (24 May 2006)

No answer to your last question, I'm afraid.

So you are saying that when you look in the Plugins folder, the script is missing? Or is it that they don't show in the Plugins menu in SU? If it is the former, I think you'll need to reformat your HD. Sorry, couldn't resist. 

If it is the latter, open the script in question in Notepad or Wordpad. Scroll to the bottom and read the last few lines. That will tell you where the script will show up in SU. Keep in mind some scripts are context sensitive and only show up in the context menu when you have something selected on which the script can act. Windowizer is one that is like that.

Some scripts will show up in other menus so you need to look in them, too. I have edited some of the scripts that appeared in the Plugins menu so that they are in the Tools or Draw menus because that makes more sense to me and it shortens the Plugins menu.

The scripts you can't read are probably .RBS instead of .RB. They are scrambled by the writer so others can't edit them. GSU evidently doesn't support scrambled Rubies but SU5Pro does.

Hope that helps.


----------



## SketchUp Guru (24 May 2006)

Here's an example of the part of the script that tells you where the script will be accessed. I copied if from your Fillet post. the part in bold text is the part you want to see. You could change Plugins to Tools for example and FilletTool would appear in the Tools menu. You can simply edit the text and save the file to make this happen.

end # of class FilletTool 
#---------------------------------------------------------------------------- 
def frametool 
Sketchup.active_model.select_tool FilletTool.new 
end 

if( not file_loaded?("FilletTool.rb") ) 
*UI.menu("Plugins").add_item("FilletTool")* { Sketchup.active_model.select_tool FilletTool.new } 
end 
#----------------------------------------------------------------------------- 
file_loaded("FilletTool.rb") # load"FilletTool.rb"


----------



## Alf (24 May 2006)

Steve Maskery":1430ehyf said:


> PS As an aside, does anyone know why it takes Microsoft half an hour to seach my little PC whilst Google can seach the entire planet in a millisecond?


It's 'cos the entire planet reformats regularly...


----------



## Steve Maskery (24 May 2006)

Dave,
Yes, that's my understanding, too.

But I have, in the plugins menu, "Copy long path". It doesn't seem to do anything I shall ever need, so I'd like to get rid of it. None of the scripts in the Plugins directory contain the string "Copy along path", so I can't find out which particular script to remove.

Is that any clearer?

Cheers
Steve


----------



## SketchUp Guru (24 May 2006)

Yes, that is clearer. Let me investigate.


----------



## SketchUp Guru (24 May 2006)

Got it!

Look for pathcopy.rb and delete that. Actually, before you delete it, open it and scroll to the bottom. You'll see the menu entry.

If you are getting rid of it, also get rid of vector.flat_angle.rb and pathcopy cursor.png. They are associated with pathcopy.rb

If you don't want to delete these because you might want them later, change pathcopy.rb to pathcopy.rb.txt and it won't appear in the menu.


----------



## Steve Maskery (24 May 2006)

Thanks Dave. Great.
I'm still puzzled though - I don't seem to have vector.flat_angle.rb and pathcopy cursor.png at all (at least, I can't find them) and I still don't understand why my Windows search didn't find the string "Copy along path" when I asked it to look inside the files. 
Please don't tell me to buy a Mac. Apart from anything else, I haven't got time to go shopping for new computers, I'm too busy reformatting.

If you can't beat 'em...
Hey ho.

Cheers
Steve


----------



## SketchUp Guru (24 May 2006)

Maybe those other files aren't there. I was looking on a Ruby library site and found a zip file that included all three of those files. I just assumed you picked up the script there. Or maybe you did but only extracted the pathcopy.rb script.

I don't know why Windows search wouldn't find that text string. Weird.


----------



## Steve Maskery (24 May 2006)

It won't find ANY text string!

I've just searched for "random" in all files in the plugins directory, and it returns no results!

Terrific.  

Cheers

Steve


----------



## SketchUp Guru (24 May 2006)

You do know what that means, then. The R word. :shock: :lol:


----------



## Neomorph (24 May 2006)

Steve Maskery":3i9ob76f said:


> Dave,
> Yes, that's my understanding, too.
> 
> But I have, in the plugins menu, "Copy long path". It doesn't seem to do anything I shall ever need, so I'd like to get rid of it. None of the scripts in the Plugins directory contain the string "Copy along path", so I can't find out which particular script to remove.
> ...



Steve you need something called Files Search Assistantbecause one thing about XP is it's really crappy search routines. FSA allows you to search inside files and grades them with a percentage as to how relevant it is. It will allow you to find the offending scripts dead easy. :wink:

It's not cheap but it is by far the best search program I've used.


----------



## Neomorph (24 May 2006)

Steve Maskery":4w2ttn1n said:


> It won't find ANY text string!
> 
> I've just searched for "random" in all files in the plugins directory, and it returns no results!
> 
> ...



Steve its the XP search engine... It's total BLEEEEEEEEEP! :lol:


----------



## gidon (24 May 2006)

Steve
Have a look at Google Desktop- it will transform how you store and search files on your computer. Once it's done its indexing it is lightning fast. It will even do you e-mail - both Exchange and Express.
Cheers
Gidon


----------



## Steve Maskery (24 May 2006)

Thanks guys.

Gidon, I have Google Desktop, but I can't see where it looks inside files for strings. Am I missing something?

Cheers
Steve


----------



## Neomorph (24 May 2006)

Steve you can download a trial of FSA *here*. You should at least be able to find the text you are looking for even if you don't buy the package. :wink:


----------



## gidon (24 May 2006)

Steve - it automatically searches inside files. There are some options for quick find in your preferences to disable this but but default it does it.
Cheers
Gidon


----------



## Steve Maskery (24 May 2006)

gidon":li79c0ln said:


> There are some options for quick find in your preferences to disable this but by default it does it.



In that case, Gidon, it's no better than Windows 

FSA, on the other hand, found everything I've asked of it. Great for a trial, but too much dosh for the rare occurrence when I'll really nead it. Still, I've got 30 days.

Cheers
Steve


----------



## gidon (24 May 2006)

Steve - sorry I don't understand - GDS _does _search any strings in any files - and a lot quicker than XP. You can put the string in double quotes if you want to narrow your search. Maybe I've misunderstood what you're trying to do?
Cheers
Gidon


----------



## Steve Maskery (24 May 2006)

Gidon,

I mean that many of the rb files contain, for example, the word "Ruby". If I ask GD or XP search engines to seach for "Ruby", the rb files are not in the search results. File _names_ with the string "Ruby" are found, but not files which are not called "Ruby" but have the string "Ruby" inside them.

In XP I have the "Look inside files" switch turned on. I can't see an equivalent in GD.

It does seem very strange to me. Is it becasue they are .rb files rather than .txt files? Doesn't seem very likely. 

As I say, the same search using FSA worked fine.

Cheers
Steve


----------

