Help for Macfriendlying a plugin (Jim's custom toolbar)
-
I tried to use Jim's custom toolbar but it only accesses sketchup commands (I'm on MAC) not plugins. I tried to get into it and modify it to access all plugins by name but I'm not 100% sure of how yet.
I'm pretty sure it's a directory issue, it only looks into the proper subfolder (toolbars>Files>sketchup).I figure either I could add another place for it to look (like this folder and the plugin folder), with a command such as: dir = File.dirname(FILE) or Path=File.join etc.. and proper direction, or in the "if file.exist" loop, add a look somewhere else (in plugin folder).
And then I probably have to create another folder with copies of the icons (as they could be all over the place) which I would also use for new icons for tools that don't have them yet.
Anybody can help? I'm not really experienced in Ruby so I'd have to understand what those do exactly before.Thanks
-
It's not a simple thing like pointing buttons at files.
Although some scripts (these would be linear command scripts that load, do their thing and finish,) can be run with a load 'filename.rb' command; many real Plugins are complex with multiple files. Thess complex Plugins are not run like a linear command file (aka like the old DOS batch command scripts.) They either already have a menuitem object created to run them, or if they are a toolbar enabled Plugin, then they'll have a UI::Command object already created for them.
-
You need to make backups of your Plugins folder (before hacking.)
-
You need to learn Standard Ruby.
-
See the list I posted over at GoogleGroups. Lots of:* free books in PDF form * online Ruby Tutorials * RUBY RESOURCES (Links)1. Then delve into the Sketchup API for Ruby. You'll need to read the API on:
-
the UI::Toolbar class* the UI::Command class.* the UI::Menu class
-
-
Thanks!
Yeah I know about the different files and such and this one is such a complex branched one, a beautifully programmed one. As for the sketchup API (toolbar, command and menu) I'm not 100% fluent yet, but getting there, already fixed many plugins.
The thing is it seems to me that it's a difference in file behavior from the PC to the Mac, as if I understand comments made it behaves properly on the PC (looks in the plugin folder) but doesn't seem to on the Mac. Since Jim wrote it for PC there may be a quirk on Mac for which there is a way around that someone had already encountered.
Of course I won't hack without backup and protections and what not, and without understanding the behavior of the original program, but I can only imagine what it does on a PC and see what it does or doesn't on the Mac.
In this case the program and the UI work great.OK I know you're right I'll do more homework! Thanks for the links.
Advertisement