Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 10.4 ('Extreme Programming')
Instant purchase and download via GumRoad!


Scripting Interfaces

Adding a User Interface to Your RBScript

Issue: 10.4 (May/June 2012)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 12,845
Starting Page Number: 65
Article Number: 10409
Resource File(s):

Download Icon project10409.zip Updated: 2013-03-11 19:07:57

Related Link(s): None

Excerpt of article text...

As you probably know, RBScript is one of my favorite features of Real Studio. I have been using it more and more as it really makes my applications so much more powerful. It's a great way to externalize code so I don't have to recompile my entire project just to make a tiny change.

One key limitation of RBScripts is that they don't have a user interface. For many uses of RBScript that's not a problem—the script simply does the processing on data established from the main program. However, what if a script needs to ask the user a question?

I recently decided to enhance my "filename cleaner" app I created as part of my "Scripting for Fun and Profit" article in RSD 7.1. You'll remember that that app is a simple file renamer app that gets its instructions—how it renames—via external RBScripts, making it easy to customize for any need.

When I had a bunch of filenames with the same text in them which I wanted changed, I could have simply written a custom script to make that change. But what about the next time I had a similar situation? I'd have to edit my script every time I wanted to do a "find-replace" type rename. It would work far better if my script could ask for input and allow me, at runtime, to put in the old and new text for the filename.

But since RBScript can't throw up a dialog box, how would I make this happen?

It's All in the Context, Baby

...End of Excerpt. Please purchase the magazine to read the full article.