<div style>This can be done inside called page by JavaScript with out php at all if it is not available...</div><div style><br></div><div style>"You can call a php script on your local (organisation) or www server passing variables to it in the html query, and show a page that maintains an associative array that determines </div>
<div style>whether the script has a new version for download or not and </div><div style>displays an appropriate message to the User."</div><div style><br></div><br><div class="gmail_quote">On 12 January 2012 19:43, Paul A Norman <span dir="ltr"><<a href="mailto:paul.a.norman@gmail.com">paul.a.norman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>These new properties on TW.script  have made  something worthwhile possible for checking for updates on scripts... in fact "TW.script.date" may even be worthwhile?</div>
<div><br></div><div>
Some draft notes I've added to the API ...</div><div><br></div><div><div>"It is possible to think through ways of including methods people can use to check for any new Update for your script if you are giving it away, or it is on an organisations local web server.</div>

<div><br></div><div>"Although direct access is not given to the web, TeXworks does provide a system command for launching files by address. (There is no guarantee that a system call to wget or like will work on all systems.)</div>

<div><br></div><div>"Provide an option on your form, or in a drop down box or other for the User to be able to check for a new version.</div><div><br></div><div>"You can call a php script on your local (organisation) or www server passing variables to it in the html query, and show a page that maintains an associative array that determines </div>

<div>whether the script has a new version for download or not and </div><div>displays an appropriate message to the User.</div><div><br></div><div>       var thisFileName =  TW.script.fileName.substr(</div><div>                        TW.script.fileName.lastIndexOf("/") +1</div>

<div>                                                  );</div><div><br></div><div>var checkFile = "checkFile.php?script=" + thisFileName </div><div>                + "&version=" + TW.script.version;</div>

<div>     </div><div>   var whatHappened =  TW.launchFile( // there is a strong security check on this</div><div><br></div><div>                          "<a href="http://twscript.paulanorman.info/downloads/" target="_blank">http://twscript.paulanorman.info/downloads/</a>"</div>

<div>                          + checkFile </div><div>                                     );</div><div>      </div><div>      if (whatHappened.status != 0) // call failed</div><div>        {</div><div>         TW.information("What Happened", whatHappened['message']);</div>

<div>         } // </div><div><br></div><div><br></div><div>"Or a more basic approach is to point to a down load page with version information already shown. This would mean showing the User what the script name and version number were perhaps as part of any form, drop-down (getItem) or Information box being presented to them.</div>

<div><br></div><div>var thisOne = TW.getItem(null, "Please Choose",  "This is: " + TW.script.title  </div><div>                         +  " version: <b>" + TW.script.version </div><div>

                         +"</b>  "+ thisFileName                             </div><div>//  Not available        + "<br> Dated : " + TW.script.date</div><div>                              + "<br> Please Check for Updates at\n   <span style='color:navy; text-decoration: underline; cursor:none' title='Choose Update from Drop Box'><a href="http://twscript.PaulANorman.info" target="_blank">twscript.PaulANorman.info</a></span>"</div>

<div>                             </div><div>                            +"<br><br>Please Choose..."</div><div>                            , mainList // mainList is an array</div><div>                            , 2</div>

<div>                            , false</div><div>                            );</div><div><br></div><div>"Then something like...</div><div><br></div><div>      var whatHappened =  TW.launchFile("<a href="http://twscript.paulanorman.info/downloads/" target="_blank">http://twscript.paulanorman.info/downloads/</a>");</div>

<div>      </div><div>      if (whatHappened.status != 0) // call failed</div><div>        {</div><div>         TW.information("What Happened", whatHappened['message']);</div><div>         } // </div><span class="HOEnZb"><font color="#888888"><div>

<br></div><div>Paul</div></font></span><div><div class="h5"><br><div class="gmail_quote">On 12 December 2011 12:44, Paul A Norman <span dir="ltr"><<a href="mailto:paul.a.norman@gmail.com" target="_blank">paul.a.norman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Awesome thanks Stefan, I'll write that into the Scripting api.<br>
<br>
Actually in one dialogue box I have been making for inserting images<br>
into .tex docs, I actually have been showing the version number of the<br>
script in the dialogue so that people would be able to see whether<br>
they need to upgrade or not - so far I have had to read the script<br>
itself into memory and search for the string.<br>
<br>
So "for the sake of completeness" - the completeness principle proves<br>
itself again.<br>
<span><font color="#888888"><br>
Paul<br>
</font></span><div><div><br>
On 12 December 2011 00:01, Stefan Löffler <<a href="mailto:st.loeffler@gmail.com" target="_blank">st.loeffler@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> On 2011-11-20 09:57, Paul A Norman wrote:<br>
>> Seems any script locating the script's directory through __FILE__ no<br>
>> longer works when the Debugger is off (eg .ui(s)). I don;t know when<br>
>> this started but I am reasonably sure I have not had this happen at<br>
>> all before now. I can not say what version of TW I last successfully<br>
>> ran __FILE__ with Debugger off I am sorry.<br>
>><br>
>> Is this a new Qt  4.7.3  feature (hmm), or something I should put on<br>
>> Tw issues?<br>
><br>
> I assume it's a Qt-related thing. In r952, I added a couple of<br>
> properties to deal with that. The new properties are (as visible in<br>
> scripts):<br>
> TW.script.fileName<br>
> TW.script.title<br>
> TW.script.description<br>
> TW.script.author<br>
> TW.script.version<br>
><br>
> Probably only fileName is of any real interest (as the others are<br>
> defined exclusively by the script author), but I thought I'd include the<br>
> rest for the sake of completeness, too.<br>
><br>
> HTH<br>
> Stefan<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>