Making Script Packages For Distribution

If all goes well and NPDS takes off in the remaining Newton community, perhaps we'll see a trade in neat scripts that run under the NPDS SSA. In order to facilitate this, I have made it pretty easy to roll a script you write into a script package like the ones that come with this issue of 4•AA,. All you need is a a copy of the Newton Toolkit for Mac or Windows and a good script. Go install NTK if you have not already, learn how to connect the Inspector to your Newton, then come back to this page.

OK. You're back. Download the proper NTK Project (Mac | Windows) and decompress it. Make a copy of this folder on your desktop. Now connect your Newton to the NTK Inspector and open the NPDS script editor. Flip through the list of scripts until you get to the one you want to share.

In the inspector, type "GetRoot().|Editor:MAVON|:ScriptToInspector();" and hit ENTER (not return). You'll get a text dump of your script file. Copy and paste this into a decent text editor. I use BBEdit on the Macintosh and I am sure there's a good one on the PC end of things. You need to search and replace every quotation mark " with a backslash-quotation mark "\ This is because the quotation mark is a special character under Newtonscript.

Switch back to NTK and open the copy of the project file you made on the desktop. You'll get a window with the source file listed in it. Double-click on the source file and you'll see the following text inside it:

local script:=

{name: "Script Name",

active: TRUE,

static: NIL,

ssitag: "SSI",

text: ""};

Edit the name to be the name of your script as it shows in the Script Editor's Info line, assign a SSI tag to this script, and then switch to your text editor. Copy the altered script text and paste it between the quotation marks of the text slot. Now save in case something goes awry.

To create your script package, choose build package from the Project menu of NTK. A package will appear in the Script Template folder. You can now go and rename the package to whatever you wish.

To test the installability of your new script, choose "Install Package" from the Project Menu. You'll get a dialog on your Newton informing you of your success. Some warning is in order here as you will now have two copies of the same script in your Script Soup. This can have unanticipated results. Delete one as soon as you are sure this whole process worked.

Happy Scripting and I hope to see some cool scripts!