I continue to play with PrimalForms and I know many of you are as well. I thought I’d share a few other techniques for creating scripts and moving between the code generated by PrimalForms and the script you create in PrimalScript. One technique that I’ve started using is to leverage PrimalScript’s snippet feature.
Like many of you I’ll start with a basic form and begin building a script. Inevitably I have to go back and modify the form. Before I do so, I select my script block section, right click, and use the Save as Snippet feature. I use a name like ‘Temp’. In PrimalForms, I copy to the clipboard, return to PrimalScript and paste into my script file. Delete the script block, type temp followed by Ctrl-J and there it is. My script block is back. I then make other adjustments as necessary depending on the changes I made. A variation is to use PrimalScripts clipboard ring, by first copying my script block, then using Ctrl+Shift+V to cycle through until I find the text I’m after.
In the SAPIEN support forums, a user shared his technique which I also like. Create a script from PrimalForms. The next time you need to modify the form and script, open the script in PrimalScript. Modify the form and export the result to a file. In PrimalScript, use the compare files feature to compare your script with the exported file. PrimalScript will highlight all the differences. All you have to do is copy and paste the differences from the exported file to your script. This can be made even easier by splitting the window so that you can see your script and the compare files tab. Select text then drag and drop it into your script. What do you think of that?!
Oh, and because I needed something to work with, I created another simple form that connects to a computer and displays when it last booted and how long it has been up. This form uses a custom icon that the form expects to find in the same directory as the ps1 file.
Download a zip file with the form, script and icon here.