| Date: | Wed, 2 Mar 2005 07:26:23 -0600 |
| Reply-To: | "Peck, Jon" <peck@spss.com> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | "Peck, Jon" <peck@spss.com> |
| Subject: | Re: Creating Dialogs for Macros? |
|
| Content-Type: | text/plain; charset="us-ascii" |
There is no really straightforward way to do this now, but there are several tools available. Within SPSS, you can use SaxBasic scripts to display a dialog box of your own construction and generate and run the appropriate syntax. SaxBasic has a dialog box editor to create simple dialogs; you write SaxBasic code to respond to the actions in the dialog, and you can populate a variable listbox by getting the GetVariableInfo method of the data document object, filtering these as you wish.
Alternatively, you can use a language like Visual Basic (any language, actually, that supports OLE automation) to write an application that controls SPSS entirely and SPSS automation methods to drive the dialogs and run syntax. All of the methods and properties available in SaxBasic are actually available to a separate application. If you really get excited about this, you can in effect entirely replace the SPSS user interface -- and we won't feel insulted :-). But if you simply want to add some gui-driven macros that can be used in the middle of SPSS jobs, creating scripts that are run from Utilities/Run Script is a better and easier approach. When you write the script, you can include a description that will show up in the Run Script dialog.
If these scripts are to be used a lot, you can create new menu items and/or toolbar buttons to invoke them more conveniently. Take a look at View/Toolbars
Regards,
Jon Peck
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of michael healy
Sent: Monday, February 28, 2005 6:41 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: [SPSSX-L] Creating Dialogs for Macros?
Hi,
I have written macros and I want to distribute at work. I'm pretty sure, however, that if people think they have to type anything even remotely code-like they'll never use them. How can I go about building a menu-driven interface for these macros? I would like to have the standard dialog format: a variable list on the left, the to-be-processed variables on the right, and maybe check boxes for options.
Thanks again,
Mike
|