{"id":61,"date":"2008-02-09T12:21:42","date_gmt":"2008-02-09T20:21:42","guid":{"rendered":"http:\/\/blog.astroplanner.net\/?p=61"},"modified":"2008-02-09T12:21:43","modified_gmt":"2008-02-09T20:21:43","slug":"scripting-part-2","status":"publish","type":"post","link":"http:\/\/blog.astroplanner.net\/?p=61","title":{"rendered":"Scripting, Part 2"},"content":{"rendered":"<p>In this posting I&#8217;ll be showing you some of the new user interface associated with scripting.<br \/>\n<!--more--><br \/>\nFirstly, when you upload your script to the on-line repository, you&#8217;ll see a somewhat modified dialog.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.astroplanner.net\/wp-content\/uploads\/2008\/02\/001.jpg\" alt=\"001.jpg\" border=\"0\" width=\"755\" height=\"646\" \/><\/div>\n<p>(oops. Ignore the User ID and Date fields. Those will disappear for the released version)<\/p>\n<p>In a similar fashion to user-contributed plans, you specify a category for the script, and also some (optional) keywords.<\/p>\n<p>Note that you can upload and overwrite a script only if you were the original creator. If not, the dialog will warn you and disallow the upload. Only registered users can upload scripts.<\/p>\n<p>Uploading scripts is now handled automatically by the server. In V1.x, it required some interaction from me before a script was posted.<\/p>\n<p>When you download scripts, you&#8217;ll see a completely new dialog, that is reminiscent of the user-contributed plan download window (see a previous post).<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.astroplanner.net\/wp-content\/uploads\/2008\/02\/scriptdl.jpg\" alt=\"scriptdl.jpg\" border=\"0\" width=\"924\" height=\"646\" \/><\/div>\n<p>The list of scripts is now hierarchical and allows you to show scripts in various ways, just like the user-contributed plans.<\/p>\n<p>There&#8217;s also a dialog that lists your scripts and allows you to delete them. No longer do you have to ask me nicely.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.astroplanner.net\/wp-content\/uploads\/2008\/02\/deletescript.jpg\" alt=\"deletescript.jpg\" border=\"0\" width=\"860\" height=\"490\" \/><\/div>\n<p>Finally, a whole new concept: Event scripts. You can specify scripts to be run when various events occur. For example, when a plan document is opened, you might want to run a script automatically to compute some user-defined fields, etc.<\/p>\n<p>Here&#8217;s the (preliminary) dialog that allows you to select the events to be scripted.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.astroplanner.net\/wp-content\/uploads\/2008\/02\/scriptevents.jpg\" alt=\"scriptevents.jpg\" border=\"0\" width=\"590\" height=\"400\" \/><\/div>\n<p>You can specify an event script either as just for the currently open plan document, or globally for all plan documents.<\/p>\n<p>Oh, yes, I should mention that scripts that are run more than once are now only compiled on the first run, so that the second and subsequent runs are considerably faster (typically a few milliseconds), since the scripts are actually compiled down to machine code, not interpreted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this posting I&#8217;ll be showing you some of the new user interface associated with scripting.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-version-2"],"_links":{"self":[{"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":0,"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.astroplanner.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}