[Plugin] Plugins help script

[Plugin] Plugins help script

Postby Didier Bur » Fri Jan 25, 2008 9:49 pm

As AdamB suggested, here is a script for quickly accessing plugins help files.
It searches in the Plugins folder and its sub-folders for pdf,doc,chm,html files and builds a list from which you can select the file to read.
Select Plugins menu > Plugins Help files
;)
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: Plugins help script

Postby TIG » Sat Jan 26, 2008 12:52 am

...{... if @ext.include? x.split(".")[1] }

works for files containing names IF you use this to strip off the suffix/extension

...{... if @ext.include? x.split(".").last }
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby azuby » Sat Jan 26, 2008 1:38 am

OK, here is my try for accessing help files out of Sketchup. It uses the some technics as Didiers script for showing the files, but my attempt scans the Directories in another way and recursively builds a nested menu structure.

Unfortunately there needs to be a lot checking, because we all know, that we can not access existing menus later.

Go to http://www.errorinitus.de/ > Software > PluginsHelp

azuby
0
error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

Bad English? PM me, correct me. :)

azuby 
 

Re: Plugins help script

Postby Didier Bur » Sat Jan 26, 2008 1:45 am

Azuby,
That's just what I wanted to do, you beat me on this ! :thumb:
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: Plugins help script

Postby TIG » Sat Jan 26, 2008 12:05 pm

Your method fails to find 'help' files within the Plugins directory itself - only does sub-folders ? Should be easy enough to fix... BUT it is very slow at start up building the list. I still think a dialog solution that builds the list as you want it is better...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby azuby » Sat Jan 26, 2008 1:22 pm

Yes, it is slow. It is a try, not a well to use Plugin. And you are right with the Plugins and Tools menu :oops:

It is slow because of many checks for folder content and because I don't want to have empty submenus.

Figure that out:
- Plugins : check for contained help files in its subdirectorys *
-- a : check for contained help files in it and its subdirectorys *
--- a1 : check for contained help files in it and its subdirectorys *
---- a11 : check for contained help files in it and its subdirectorys *
--- a2 : check for contained help files in it and its subdirectorys *
-- b : check for contained help files in it and its subdirectorys *

* and if it containeds help files, build a submenu.

a11 gets checked 4 times if it contains help files. The more nested the folder structure the more time will be need.

OK, who's next with a solution? [b]Idea[b]: Scan the folders with Dir.glob and create a WebDialog containing links to the help documents in a frameset.

azuby
0
error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

Bad English? PM me, correct me. :)

azuby 
 

Re: Plugins help script

Postby TIG » Sat Jan 26, 2008 9:38 pm

Here's my reworking of Didier's script for a dialog version. It makes an alphanumeric list of any plugins' help files. in the resulting window it displays the path in the top bar etc. It appears in the 'Help' menu, but it is easily changeable to appear in 'Plugins'. It is fast...

Thanks Fredo6 - must've hit a key between testing it and uploading it !!! corrected script re-uploaded !
0
Last edited by TIG on Sun Jan 27, 2008 12:13 am, edited 3 times in total.
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby fredo6 » Sat Jan 26, 2008 11:13 pm

TIG,

There is an error, due to a missing closing brace '}' on line 22.

Otherwise, it seems to work, though I may prefer to have the menu / submenu version (one suggestion would be to build the submenus at first call, rather that systematically at load time).

Thanks a lot
0
User avatar
fredo6 
PluginStore Author
PluginStore Author
 

Re: Plugins help script

Postby TIG » Sun Jan 27, 2008 12:12 am

Fredo6 wrote:TIG,

There is an error, due to a missing closing brace '}' on line 22.

Otherwise, it seems to work, though I may prefer to have the menu / submenu version (one suggestion would be to build the submenus at first call, rather that systematically at load time).

Thanks a lot

Fixed it !
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby azuby » Sun Jan 27, 2008 12:18 am

Fredo6 wrote:[...] though I may prefer to have the menu / submenu version (one suggestion would be to build the submenus at first call, rather that systematically at load time).
Please excuse, do you mean my version? A "build menu on demand" is possible. I'll do it soon, at this moment my Sketchup processes a really huge modell (250.000 points, 60.000 faces) and isn't usable ;)

azuby
0
error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

Bad English? PM me, correct me. :)

azuby 
 

Re: Plugins help script

Postby fredo6 » Sun Jan 27, 2008 1:31 am

Azuby,

In theory, we could imagine that a user would not call a PDF at each Skecthup session, and if he does, after all, he could wait a little bit.
But your macro is fast enough that this fine too. When we have hundreds of PDF and HTML documenting scripts, we could revisit the problem ;)

All this proves that we have a damned good team of Ruby script programmers on this forum, as it took less than 24 hours to get 3 good versions after the idea just popped up.
0
User avatar
fredo6 
PluginStore Author
PluginStore Author
 

Re: Plugins help script

Postby azuby » Sun Jan 27, 2008 9:45 am

For this, the folder structure is also important, because the deeper the structure the slower tht menu building. So we really could do it better (because for the WebDialog frames version we only need ONE folder scan).

azuby
0
error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

Bad English? PM me, correct me. :)

azuby 
 

Re: Plugins help script

Postby watkins » Sat Feb 16, 2008 12:33 pm

Dear TIG,

Do you think you could modify your script to include simple text documents? I ask because when I install a plugin which isn't supplied with a help/readme document (more recently a .pdf file), I create my own help/readme document by making a simple text file and then cutting and pasting any explanation posted with the ruby script. I now have quite a few of these 'readme' files and it would be really useful if I could access them from the Help drop-down menu.

Many thanks,
Bob
0

watkins 
 

Re: Plugins help script

Postby Jim » Sat Feb 16, 2008 12:45 pm

I would go a step further and automatically parse out the header text from the script itself.

In fact would go even further and suggest authors adopt RDoc, or a similar embedded documentation scheme. RDoc is pure ruby, can be included in the Plugins folder, and creates nicely formatted documentation.
0
Hi

Jim 
Global Moderator
 

Re: Plugins help script

Postby Edson » Sat Feb 16, 2008 3:03 pm

didier,

look what happened to your script on mac: there seems to be a problem as it does not see all i have and does not return anything. after this post i there is one on TIG version of the script, that appears to be working.

PluginsListA_01.png

PluginsListA_02.png
PluginsListA_03.png
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: Plugins help script

Postby Edson » Sat Feb 16, 2008 3:08 pm

TIG,

this is what happened to your script on mac: it seems to be working fine.

PluginsListB_01.png
PluginsListB_02.png
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: Plugins help script

Postby TIG » Sat Feb 16, 2008 7:14 pm

Edson wrote:TIG,
this is what happened to your script on mac: it seems to be working fine.

PluginsListB_01.png
PluginsListB_02.png

So Edson, you are saying that my version works OK ?

Note: the reason mine lists one more help-file than the other version is that it looks in all of the sub-folders in the Plugins folder and lists any it finds in there too...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby TIG » Sat Feb 16, 2008 7:23 pm

watkins wrote:Dear TIG,

Do you think you could modify your script to include simple text documents? I ask because when I install a plugin which isn't supplied with a help/readme document (more recently a .pdf file), I create my own help/readme document by making a simple text file and then cutting and pasting any explanation posted with the ruby script. I now have quite a few of these 'readme' files and it would be really useful if I could access them from the Help drop-down menu.

Many thanks,
Bob

The problem is that many people add a .txt suffix to the end of the name of any scripts they don't want to have always loaded - they can 'load "script.txt"' through the Ruby Console later if needed. If the help script listed all .txt files these would come up in the list too. The formats that are found and listed are pdf htm html mht and doc - so you could make the txt files into doc ones ? OR you could make your help files end with a suffix .bob and set .bob files always to open with NotePad.exe; then edit the script and add ".bob" to the list of files it finds - easy to see how it works - and off you go...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby watkins » Sat Feb 16, 2008 10:58 pm

Dear TIG,

Many thanks for your helpful suggestions. I will give it a go.

Kind regards,

.bob
0

watkins 
 

Re: Plugins help script

Postby watkins » Sat Feb 16, 2008 11:08 pm

Dear TIG,

I wrote before thinking (not unusual). I simply added "txt" to the list as I almost never load scripts using 'load "script.txt"' through the Ruby Console. This is a quick fix, although I should think about doing what you suggested in the future and loading little used scripts via the Ruby Console.

Kind regards.
.txt
0

watkins 
 

Re: Plugins help script

Postby Edson » Sat Feb 16, 2008 11:11 pm

TIG wrote:So Edson, you are saying that my version works OK ?


yes, it seemed to work fine but i was unsure of it since i did not know whether the result i obtained was the one to be expected from the script or not. is it what you expected?
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: Plugins help script

Postby watkins » Sat Feb 16, 2008 11:30 pm

Dear TIG,

Its me again (bad penny and all that).

Okay, adding .txt works fine, except that for long text files I can only see what will fit on the screen (no vertical scroll bars). I note that .pdf files open with scroll bars and so viewing them is just fine. I also have a lot of .txt files in my plugin folder and so when I try to select a file I can only view/select those that are visible in the text window. It would be useful if your script could be made to work like the Plugin drop-down menu, viz. the window opens and stays open with a single click and then items on the list are accessed (if required) using up/down arrows. This might be a useful feature anyway as users are likely to accumulate lots of .pdf help files with time.

Kind regards,
Bob
0

watkins 
 

Re: Plugins help script

Postby TIG » Sun Feb 17, 2008 12:36 am

Edson wrote:
TIG wrote:So Edson, you are saying that my version works OK ?


yes, it seemed to work fine but i was unsure of it since i did not know whether the result i obtained was the one to be expected from the script or not. is it what you expected?

Yes - all is OK.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby TIG » Sun Feb 17, 2008 12:43 am

watkins wrote:Dear TIG,

Its me again (bad penny and all that).

Okay, adding .txt works fine, except that for long text files I can only see what will fit on the screen (no vertical scroll bars). I note that .pdf files open with scroll bars and so viewing them is just fine. I also have a lot of .txt files in my plugin folder and so when I try to select a file I can only view/select those that are visible in the text window. It would be useful if your script could be made to work like the Plugin drop-down menu, viz. the window opens and stays open with a single click and then items on the list are accessed (if required) using up/down arrows. This might be a useful feature anyway as users are likely to accumulate lots of .pdf help files with time.

Kind regards,
Bob

Making the top bar menu list is what takes the time and slows down any model opening - and it's what we are trying to avoid... It's a limitation of the current Ruby dialogs that long lists go off the screen. However if you type the first character of the likely file's name e.g. W for Windowizer_help then the list will jump to that (or at least near that) and scrolling down is then possible... This applies to lots of Ruby dialogs like ones listing layers or colours. It could be done better with a web-dialog... but others have that expertise (and time) - perhaps someone can clobber 'my' getting the list of files into 'their' web-dialog and make it run as a superior form of dialog... before the Ruby dialogs themselves get improved (if ever)...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugins help script

Postby watkins » Sun Feb 17, 2008 8:27 am

Dear TIG,

Once again, thanks for giving my enquiries your consideration.

Kind regards,
Bob
0

watkins 
 

Re: [Plugin] Plugins help script

Postby Oxer » Thu Sep 24, 2015 2:29 pm

Hi, I installed the plugin (TIG version), the plugin appears in Help Menu and you can select a help file but there is a problem, the popup windows of the helps are empty, they don't show the content of the help files, I tried with all extension types (txt, pdf, html...), see the image.

Empty help windows help.jpg


My intention is create a subfolder into Sketchup plugin folder with all help files of the plugins.

Somebody can help me.

Thanks !!

OSX 10.10.5
SU 2015
0
"The result is the end what is important is the process" by Oxer
http://www.oxervision.blogspot.com/
User avatar
Oxer 
 

Re: [Plugin] Plugins help script

Postby TIG » Thu Sep 24, 2015 7:40 pm

This is a VERY old script.
You are on MAC so I suspect an issue there...
Wait a while as I look into it...
1
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Plugins help script

Postby Oxer » Thu Sep 24, 2015 8:08 pm

Waiting your help TIG. :thumb:
0
"The result is the end what is important is the process" by Oxer
http://www.oxervision.blogspot.com/
User avatar
Oxer 
 

Re: [Plugin] Plugins help script

Postby driven » Thu Sep 24, 2015 8:22 pm

oxer

do they show if you Right Click >> Reload?
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Plugins help script

Postby TIG » Thu Sep 24, 2015 8:47 pm

Try this version.
It should work on PC and MAC.
Read the file to see how it traps out certain 'htm' files that are NOT Help files...
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 20 guests

Visit our sponsors: