Thanks!
I found the solution...
[update 2013-01-23]
def popup(msg="", timeOut=0, posX=20, posY=70) # 2013-01-23 onidarbe () gmail
# Popup a message (including html-tags & \r) with a timout and auto-resize the window
# A click on the popup-window will disable timeOut and has to be closed manually
# To see how it's working, add border;1px solid black; in the <div style='...'>
htmlCode = %{
<html onclick='clicked();' >
<div id='div' style='float;left; white-space;nowrap;' >
#{msg.gsub(/\r/,"<br>\n")}
</div>
<script type='text/javascript'>
width=document.getElementById('div').offsetWidth;
height=document.getElementById('div').offsetHeight;
document.write("<input type='hidden' id='width' value='" + width + "'/>");
document.write("<input type='hidden' id='height' value='" + height + "'/>");
function clicked() { location = 'skp;clicked' };
document.body.scroll = "auto";
</script>
</html>
}
win = UI;;WebDialog.new( "" )
# NOTE; Variables made up on multiple lines have only a \n at the end of each line!
# "View source" with Windows Notepad needs to have \r\n
win.set_html( htmlCode.gsub(/\r\n|\n\r|\n|\r/,"\r\n") )
# Although WebDialog without pref_key doesn't keep size or location, set_size does!
# Thereby start with a smaller window instead of a larger previous version
win.set_size( 130, 30 )
win.set_position( posX, posY )
win.show
UI;;start_timer( 0, false ) {
win.set_size( win.get_element_value("width").to_f+60,
[800, win.get_element_value("height").to_f+80].min )
}
if timeOut != 0
timerID = UI;;start_timer( timeOut, false ) { win.close }
win.add_action_callback( "clicked" ) { UI.stop_timer( timerID ) }
end
end
pluginPath = Sketchup.find_support_file( "Plugins" )
Dir.chdir( pluginPath )
rbFiles = Dir[ "*.rb" ]
popup( "<B>All plugins;</B>\r#{pluginPath }\r\r#{rbFiles.join("\r")}", 2 )