Thanks for the direction. Here is how I ended up doing it - very close to Whaat's method. The main difference is I am loading a very small page in the web dialog, not getting the contents of the text file. I had trouble getting the $.get method to work...javascript newbie, I am...
This is the code in the ruby script. I basically open the webdialog during the startup of Sketchup. The web page loaded in the dialog (from my server) just returns the current build code. I had to add the UI.start_timer to pause a second to let the javascript happen, then close the web dialog
current = $current.to_s
if Sketchup.is_online
ssupdate = UI;;WebDialog.new("Check for Updates", false, "Check for Updates", 200, 200, 200, 200, true)
ssupdate.add_action_callback("check_current_version") {|d,p|
version=p.to_s
if version>current
text="A newer version of Lakefront Layout is available. Would you like to update?"
result=UI.messagebox(text,MB_YESNO)
if result==6 #yes
UI.openURL("http://www.shorestation.com/")
end
end
}
ssupdate.set_url("http://www.shorestation.com/IPADock/Sketchup/checkupdate.html")
ssupdate.show
id = UI.start_timer(1, false){ssupdate.close}
end#if
Here is the html file I have on y website:
the 20111112 is the date code of the latest build. This is what I edit when I want to push a new update.
<html>
<script>
function check_current_version() {
window.location='skp;check_current_version@'+20101112;
}
window.onload = check_current_version()
</script>
<body>
</body>
</html>
I am sure this is not the greatest approach, but it is working. Again, thanks for the help -great forum!
Jon