Académique Documents
Professionnel Documents
Culture Documents
*yping this in and hitting @nter yields the e+pected ans&er of I in the center &indo&"
No&, &hat if &e &anted to add more than one numberP *he FEF function can ta-e t&o or
more arguments, so this is not a problem=
(+ 3 5 6)
9no&ing that the E operator can ta-e a list of numbers to add, you might be tempted to
con$ert the abo$e to the follo&ing=
(+ 3 (5 6) 7)
:o&e$er, this is incorrect (( remember, e$ery statement in %cheme starts and ends &ith
parens, so the %cheme interpreter &ill thin- that you4re trying to call a function named
FAF in the second group of parens, rather than summing those numbers before adding
them to 0"
*he correct &ay to &rite the abo$e statement &ould be=
(+ 3 (+ 5 6) 7)
*hese are all accepted by )/)EE, Perl and ?a$a compilers" :o&e$er, the same is not true
for %cheme" ;ou must ha$e a space after a mathematical operator 7or any other function
name or operator8 in %cheme for it to be correctly interpreted by the %cheme interpreter"
Practice a bit &ith simple mathematical e1uations in the %cript(Fu )onsole until you4re
totally comfortable &ith these initial concepts"
GNU Image Manipulation Program
Generated by docboo-#odf
Page I/ of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
9ariables And !unctions
No& that &e -no& that e$ery %cheme statement is enclosed in parentheses, and that the
function name/operator is listed first, &e need to -no& ho& to create and use $ariables,
and ho& to create and use functions" 5e4ll start &ith the $ariables"
6eclaring 9ariables
.lthough there are a couple of different methods for declaring $ariables, the preferred
method is to use the letU construct" If you4re familiar &ith other programming languages,
this construct is e1ui$alent to defining a list of local $ariables and a scope in &hich
they4re acti$e" .s an e+ample, to declare t&o $ariables, a and b, initiali>ed to ! and #,
respecti$ely, you4d &rite=
(let* (
(a 1)
(b 2)
)
(+ a b)
)
;ou4ll ha$e to put all of this on one line if you4re using the console &indo&" In general,
ho&e$er, you4ll &ant to adopt a similar practice of indentation to help ma-e your scripts
more readable" 5e4ll tal- a bit more about this in the section on 5hite %pace"
*his declares t&o local $ariables, a and b, initiali>es them, then prints the sum of the t&o
$ariables"
What Is A 2ocal 9ariable&
;ou4ll notice that &e &rote the summation 7E a b8 &ithin the parens of the letU e+pression,
not after it"
*his is because the letU statement defines an area in your script in &hich the declared
$ariables are usable' if you type the 7E a b8 statement after the 7letU """8 statement, you4ll
get an error, because the declared $ariables are only $alid &ithin the conte+t of the letU
statement' they are &hat programmers call local $ariables"
The General 'ynta5 *) letD
*he general form of a letU statement is=
(let* ( variables ) expressions )
&here $ariables are declared &ithin parens, e"g", 7a #8, and e+pressions are any $alid
%cheme e+pressions" <emember that the $ariables declared here are only $alid &ithin the
letU statement (( they4re local $ariables"
White 'pace
Pre$iously, &e mentioned the fact that you4ll probably &ant to use indentation to help
clarify and organi>e your scripts" *his is a good policy to adopt, and is not a problem in
GNU Image Manipulation Program
Generated by docboo-#odf
Page IA of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
%cheme (( &hite space is ignored by the %cheme interpreter, and can thus be liberally
applied to help clarify and organi>e the code &ithin a script" :o&e$er, if you4re &or-ing in
%cript(Fu4s )onsole &indo&, you4ll ha$e to enter an entire e+pression on one line' that is,
e$erything bet&een the opening and closing parens of an e+pression must come on one
line in the %cript(Fu )onsole &indo&"
Assigning A $e% 9alue To A 9ariable
3nce you4$e initiali>ed a $ariable, you might need to change its $alue later on in the
script" Use the setD statement to change the $ariable4s $alue=
(let* ( (theNum 10) ) (set! theNum (+ theNum \
theNum)) )
*ry to guess &hat the abo$e statement &ill do, then go ahead and enter it in the %cript(Fu
)onsole &indo&"
*he FKF indicates that there is no line brea-" Ignore it 7don4t type it in your %cript(Fu
console and don4t hit @nter8, 2ust continue &ith the ne+t line"
!unctions
No& that you4$e got the hang of $ariables, let4s get to &or- &ith some functions" ;ou
declare a function &ith the follo&ing synta+=
(define (name param-list) expressions)
&here name is the name assigned to this function, param(list is a space(delimited list of
parameter names, and e+pressions is a series of e+pressions that the function e+ecutes
&hen it4s called" For e+ample=
(define (AddXY inX inY) (+ inX inY) )
AddXY is the function4s name and inX and inY are the $ariables" *his function ta-es its
t&o parameters and adds them together"
If you4$e programmed in other imperati$e languages 7li-e )/)EE, ?a$a, Pascal, etc"8, you
might notice that a couple of things are absent in this function definition &hen compared
to other programming languages"
" First, notice that the parameters don4t ha$e any FtypesF 7that is, &e didn4t declare
them as strings, or integers, etc"8" %cheme is a type(less language" *his is handy and
allo&s for 1uic-er script &riting"
" %econd, notice that &e don4t need to &orry about ho& to FreturnF the result of our
function (( the last statement is the $alue FreturnedF &hen calling this function" *ype
the function into the console, then try something li-e=
(AddXY (AddXY 5 6) 4)
75e added the e+pression x at the end to print out the $alue assigned to x(( normally you
&on4t need to do this" Notice ho& letU operates 2ust li-e a function= *he $alue of the last
statement is the $alue returned"8
. $ariable may also refer to a list of $alues, rather than a single $alue" *o assign the
$ariable x the list of $alues !, 0, A, &e4d type=
(let* ( (x '(1 3 5))) x)
*ry typing both statements into the %cript(Fu )onsole and notice ho& it replies" 5hen you
type the first statement in, it simply replies &ith the result=
8
:o&e$er, &hen you type in the other statement, it replies &ith the follo&ing result=
(1 3 5)
5hen it replies &ith the $alue I it is informing you that x contains the atomic $alue I"
:o&e$er, &hen it replies &ith 7! 0 A8, it is then informing you that x contains not a single
$alue, but a list of $alues" Notice that there are no commas in our declaration or
assignment of the list, nor in the printed result"
*he synta+ to define a list is=
'(a b c)
&here a, b, and c are literals" 5e use the apostrophe 748 to indicate that &hat follo&s in
the parentheses is a list of literal $alues, rather than a function or e+pression"
.n empty list can be defined as such=
'()
or simply=
()
Notice that after the first apostrophe, you no longer need to use an apostrophe &hen
defining the inner lists" Go ahead and copy the statement into the %cript(Fu )onsole and
see &hat it returns"
;ou should notice that the result returned is not a list of single, atomic $alues' rather, it is
a list of a literal 7F*he GimpF8, the list 7! # 08, etc"
o% To Thin7 *) 2ists
It4s useful to thin- of lists as composed of a FheadF and a Ftail"F *he head is the first
element of the list, the tail the rest of the list" ;ou4ll see &hy this is important &hen &e
discuss ho& to add to lists and ho& to access elements in the list"
Creating 2ists Through Concatenation AThe Cons !unctionB
3ne of the more common functions you4ll encounter is the cons function" It ta-es a $alue
and prepends it to its second argument, a list" From the pre$ious section, I suggested that
you thin- of a list as being composed of an element 7the head8 and the remainder of the
list 7the tail8" *his is e+actly ho& cons functions (( it adds an element to the head of a list"
*hus, you could create a list as follo&s=
(cons 1 '(2 3 4) )
;ou can use pre$iously declared $ariables in place of any literals, as you &ould e+pect"
6e)ining A 2ist Using The list !unction
*o define a list composed of literals or pre$iously declared $ariables, use the list function=
(list 5 4 3 a b c)
*his &ill compose and return a list containing the $alues held by the $ariables a, b and c"
For e+ample=
(let* (
(a 1)
(b 2)
(c 3)
)
(list 5 4 3 a b c)
)
&hich is=
"first"
returns=
(2 "third")
returns=
()
*o $ie& a full list of the list functions, refer to the .ppendi+, &hich lists the a$ailable
functions for the $ersion of %cheme used by %cript(Fu"
*o get some practice &ith list(accessing functions, try typing in the follo&ing 7e+cept all
on one line if you4re using the console8' use different $ariations of car and cdr to access
the different elements of the list=
(let* (
(x '( (1 2 (3 4 5) 6) 7 8 (9 10) )
)
)
; place your car/cdr code here
)
*ry accessing the number 0 in the list using only t&o function calls" If you can do that,
you4re on your &ay to becoming a %cript(Fu MasterD
In %cheme, a semicolon 7F'F8 mar-s a comment" It, and anything that follo&s it on the
same line, are ignored by the script interpreter, so you can use this to add comments to
2og your memory &hen you loo- at the script later"
<our !irst 'cript-!u 'cript
Do you not need to stop and catch your breathP NoP 5ell then, let4s proceed &ith your
fourth lesson (( your first %cript(Fu %cript"
Creating A Te5t 1o5 'cript
3ne of the most common operations I perform in Gimp is creating a bo+ &ith some te+t in
it for a &eb page, a logo or &hate$er" :o&e$er, you ne$er 1uite -no& ho& big to ma-e
the initial image &hen you start out" ;ou don4t -no& ho& much space the te+t &ill fill &ith
the font and font si>e you &ant"
*he %cript(Fu Master 7and student8 &ill 1uic-ly reali>e that this problem can easily be
sol$ed and automated &ith %cript(Fu"
5e &ill, therefore, create a script, called *e+t ,o+, &hich creates an image correctly si>ed
to fit snugly around a line of te+t the user inputs" 5e4ll also let the user choose the font,
font si>e and te+t color"
+diting And 'toring <our 'cripts
Up until no&, &e4$e been &or-ing in the %cript(Fu )onsole" No&, ho&e$er, &e4re going to
s&itch to editing script te+t files"
5here you place your scripts is a matter of preference (( if you ha$e access to Gimp4s
default script directory, you can place your scripts there" :o&e$er, I prefer -eeping my
personal scripts in my o&n script directory, to -eep them separate from the factory(
installed scripts"
In the .gimp-2.2 directory that Gimp made off of your home directory, you should find a
directory called scripts" Gimp &ill automatically loo- in your .gimp-2.2 directory for a
scripts directory, and add the scripts in this directory to the %cript(Fu database" ;ou
should place your personal scripts here"
GNU Image Manipulation Program
Generated by docboo-#odf
Page CB of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
The 1are +ssentials
@$ery %cript(Fu script defines at least one function, &hich is the script4s main function"
*his is &here you do the &or-"
@$ery script must also register &ith the procedural database, so you can access it &ithin
Gimp"
5e4ll define the main function first=
(define (script-fu-text-box inText inFont inFontSize inTextColor))
:ere, &e4$e defined a ne& function called script(fu(te+t(bo+ that ta-es four parameters,
&hich &ill later correspond to some te+t, a font, the font si>e, and the te+t4s color" *he
function is currently empty and thus does nothing" %o far, so good (( nothing ne&, nothing
fancy"
$aming Conventions
%cheme4s naming con$entions seem to prefer lo&ercase letters &ith hyphens, &hich I4$e
follo&ed in the naming of the function" :o&e$er, I4$e departed from the con$ention &ith
the parameters" I li-e more descripti$e names for my parameters and $ariables, and thus
add the FinF prefi+ to the parameters so I can 1uic-ly see that they4re $alues passed into
the script, rather than created &ithin it" I use the prefi+ FtheF for $ariables defined &ithin
the script"
It4s Gimp con$ention to name your script functions script(fu(abc, because then &hen
they4re listed in the procedural database, they4ll all sho& up under script(fu &hen you4re
listing the functions" *his also helps distinguish them from plug(ins"
(egistering The !unction
No&, let4s register the function &ith Gimp" *his is done by calling the function script(fu(
register" 5hen Gimp reads in a script, it &ill e+ecute this function, &hich registers the
script &ith the procedural database" ;ou can place this function call &here$er you &ish in
your script, but I usually place it at the end, after all my other code"
:ere4s the listing for registering this function 7I &ill e+plain all its parameters in a minute8=
(script-fu-register
"script-fu-text-box" ;func name
"Text Box" ;menu label
"Creates a simple text box, sized to fit\
around the user's choice of text,\
font, font size, and color." ;description
"Michael Terry" ;author
"copyright 1997, Michael Terry" ;copyright notice
"October 27, 1997" ;date created
"" ;image type that the script works on
SF-STRING "Text:" "Text Box" ;a string variable
SF-FONT "Font:" "Charter" ;a font variable
SF-ADJUSTMENT "Font size" '(50 1 1000 1 10 0 1)
;a spin-button
SF-COLOR "Color:" '(0 0 0) ;color variable
)
(script-fu-menu-register "script-fu-text-box" "<Toolbox>/Xtns/Script-
Fu/Text")
If you sa$e these functions in a te+t file &ith a .scm suffi+ in your script directory, then
GNU Image Manipulation Program
Generated by docboo-#odf
Page C! of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
choose 6tns %cript(Fu <efresh %cripts , this ne& script &ill appear as 6tns %cript(Fu *e+t
*e+t ,o+ "
If you in$o-e this ne& script, it &on4t do anything, of course, but you can $ie& the
prompts you created &hen registering the script 7more information about &hat &e did is
co$ered ne+t8"
Finally, if you in$o-e the Procedure ,ro&ser (( 6tns Procedure ,ro&ser 8, you4ll notice that
our script no& appears in the database"
'teps !or (egistering The 'cript
*o register our script &ith Gimp, &e call the function script(fu(register, fill in the se$en
re1uired parameters and add our script4s o&n parameters, along &ith a description and
default $alue for each parameter"
The (e@uired Parameters
" *he name of the function &e defined" *his is the function called &hen our script is
in$o-ed 7the entry(point into our script8" *his is necessary because &e may define
additional functions &ithin the same file, and Gimp needs to -no& &hich of these
functions to call" In our e+ample, &e only defined one function, te+t(bo+, &hich &e
registered"
" *he location in the menu &here the script &ill be inserted" *he e+act location of the
script is specified li-e a path in Uni+, &ith the root of the path being either toolbo+ or
right(clic-"
If your script does not operate on an e+isting image 7and thus creates a ne& image,
li-e our *e+t ,o+ script &ill8, you4ll &ant to insert it in the toolbo+ menu (( this is the
menu in Gimp4s main &indo& 7&here all the tools are located= the selection tools,
magnifying glass, etc"8"
If your script is intended to &or- on an image being edited, you4ll &ant to insert it in
the menu that appears &hen you right(clic- on an open image" *he rest of the path
points to the menu lists, menus and sub(menus" *hus, &e registered our *e+t ,o+
script in the *e+t menu of the %cript(Fu menu of the 6tns menu of the toolbo+ 7 6tns
%cript(Fu *e+t *e+t ,o+ 8"
If you notice, the *e+t sub(menu in the %cript(Fu menu &asn4t there &hen &e began
(( Gimp automatically creates any menus not already e+isting"
" . description of your script, to be displayed in the Procedure ,ro&ser"
" <our name 7the author of the script8"
" Copyright information"
" *he date the script &as made, or the last re$ision of the script"
" *he types of images the script &or-s on" *his may be any of the follo&ing= <G,,
<G,., G<.;, G<.;., IND@6@D, IND@6@D." 3r it may be none at all (( in our case,
&e4re creating an image, and thus don4t need to define the type of image on &hich
&e &or-"
(egistering The 'cript#s Parameters
3nce &e ha$e listed the re1uired parameters, &e then need to list the parameters that
correspond to the parameters our script needs" 5hen &e list these params, &e gi$e hints
as to &hat their types are" *his is for the dialog &hich pops up &hen the user selects our
script" 5e also pro$ide a default $alue"
*his section of the registration process has the follo&ing format=
GNU Image Manipulation Program
Generated by docboo-#odf
Page C# of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
Param *ype Description @+ample
%F(.LU@ .ccepts numbers and
strings" Note that 1uotes
must be escaped for default
te+t, so better use %F(
%*<ING"
/#
%F(%*<ING .ccepts strings" F%ome te+tF
%F()3L3< Indicates that a color is
re1uested in this parameter"
47B !B# #AA8
%F(*3GGL@ . chec-bo+ is displayed, to
get a ,oolean $alue"
*<U@ or F.L%@
%F(IM.G@ If your script operates on an
open image, this should be
the first parameter after the
re1uired parameters" Gimp
&ill pass in a reference to
the image in this parameter"
0
%F(D<.5.,L@ If your script operates on an
open image, this should be
the second parameter after
the %F(IM.G@ param" It
refers to the acti$e layer"
Gimp &ill pass in a reference
to the acti$e layer in this
parameter"
!H
Giving *ur 'cript 'ome Guts
Let us continue &ith our training and add some functionality to our script"
Creating A $e% Image
In the pre$ious lesson, &e created an empty function and registered it &ith Gimp" In this
lesson, &e &ant to pro$ide functionality to our script (( &e &ant to create a ne& image,
add the user4s te+t to it and resi>e the image to fit the te+t e+actly"
3nce you -no& ho& to set $ariables, define functions and access list members, the rest is
all do&nhill (( all you need to do is familiari>e yourself &ith the functions a$ailable in
Gimp4s procedural database and call those functions directly" %o fire up the D, ,ro&ser
and let4s get coo-in4D
Let4s begin by ma-ing a ne& image" 5e4ll create a ne& $ariable, theImage, set to the
result of calling Gimp4s built(in function gimp(image(ne&"
.s you can see from the D, ,ro&ser, the function gimp(image(ne& ta-es three
parameters (( the image4s &idth, height and the type of image" ,ecause &e4ll later resi>e
the image to fit the te+t, &e4ll ma-e a !B+!B <G, image" 5e4ll store the image4s &idth
and si>es in some $ariables, too, as &e4ll refer to and manipulate them later in the script"
(define (script-fu-text-box inText inFont inFontSize inTextColor)
(let*
(
GNU Image Manipulation Program
Generated by docboo-#odf
Page C0 of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
; define our local variables
; create a new image:
(theImageWidth 10)
(theImageHeight 10)
(theImage (car
(gimp-image-new
theImageWidth
theImageHeight
RGB
)
)
)
(theText) ;a declaration for the text
;we create later
Note= 5e used the $alue <G, to specify that the image is an <G, image" 5e could ha$e
also used B, but <G, is more descripti$e &hen &e glance at the code"
;ou should also notice that &e too- the head of the result of the function call" *his may
seem strange, because the database e+plicitly tells us that it returns only one $alue (( the
ID of the ne&ly created image" :o&e$er, all Gimp functions return a list, e$en if there is
only one element in the list, so &e need to get the head of the list"
Adding A $e% 2ayer To The Image
No& that &e ha$e an image, &e need to add a layer to it" 5e4ll call the gimp(layer(ne&
function to create the layer, passing in the ID of the image &e 2ust created" 7From no& on,
instead of listing the complete function, &e4ll only list the lines &e4re adding to it" ;ou can
see the complete script here"8 ,ecause &e4$e declared all of the local $ariables &e4ll use,
&e4ll also close the parentheses mar-ing the end of our $ariable declarations=
;create a new layer for the image:
(theLayer
(car
(gimp-layer-new
theImage
theImageWidth
theImageHeight
RGB-IMAGE
"layer 1"
100
NORMAL
)
)
)
) ;end of our local variables
3nce &e ha$e the ne& layer, &e need to add it to the image=
(gimp-image-add-layer theImage theLayer 0)
No&, 2ust for fun, let4s see the fruits of our labors up until this point, and add this line to
sho& the ne&, empty image=
(gimp-display-new theImage)
%a$e your &or-, select 6tns %cript(Fu <efresh %cripts , run the script and a ne& image
should pop up" It &ill probably contain garbage 7random colors8, because &e ha$en4t
erased it" 5e4ll get to that in a second"
GNU Image Manipulation Program
Generated by docboo-#odf
Page C/ of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
Adding The Te5t
Go ahead and remo$e the line to display the image 7or comment it out &ith a ' as the first
character of the line8"
,efore &e add te+t to the image, &e need to set the bac-ground and foreground colors so
that the te+t appears in the color the user specified" 5e4ll use the gimp(conte+t(set(
bac-/foreground functions=
(gimp-context-set-background '(255 255 255) )
(gimp-context-set-foreground inTextColor)
5ith the colors properly set, let4s no& clean out the garbage currently in the image by
filling the dra&able &ith the bac-ground color=
(gimp-drawable-fill theLayer BACKGROUND-FILL)
.lthough a long function call, it4s fairly straightfor&ard if you go o$er the parameters
&hile loo-ing at the function4s entry in the D, ,ro&ser" ,asically, &e4re creating a ne&
te+t layer and assigning it to the $ariable theText"
No& that &e ha$e the te+t, &e can grab its &idth and height and resi>e the image and
the image4s layer to the te+t4s si>e=
(set! theImageWidth (car (gimp-drawable-width theText) ) )
(set! theImageHeight (car (gimp-drawable-height theText) ) )
(gimp-image-resize theImage theImageWidth theImageHeight 0 0)
(gimp-layer-resize theLayer theImageWidth theImageHeight 0 0)
If you4re li-e me, you4re probably &ondering &hat a dra&able is &hen compared to a
layer" *he difference bet&een the t&o is that a dra&able is anything that can be dra&n
into, including layers but also channels, layer mas-s, the selection, etc' a layer is a more
specific $ersion of a dra&able" In most cases, the distinction is not important"
5ith the image ready to go, &e can no& re(add our display line=
(gimp-display-new theImage)
%a$e your &or-, refresh the database and gi$e your first script a runD
GNU Image Manipulation Program
Generated by docboo-#odf
Page CA of /#!
G
e
n
e
r
a
t
e
d
b
y
d
o
c
b
o
o
k
2
o
d
f
Clearing The 6irty !lag
If you try to close the image created &ithout first sa$ing the file, Gimp &ill as- you if you
&ant to sa$e your &or- before you close the image" It as-s this because the image is
mar-ed as dirty, or unsa$ed" In the case of our script, this is a nuisance for the times
&hen &e simply gi$e it a test run and don4t add or change anything in the resulting image
(( that is, our &or- is easily reproducible in such a simple script, so it ma-es sense to get
rid of this dirty flag"
*o do this, &e can clear the dirty flag after displaying the image=
(gimp-image-clean-all theImage)
(script-fu-register
"script-fu-text-box" ;func name
"Text Box" ;menu label
"Creates a simple text box, sized to fit\
around the user's choice of text,\
font, font size, and color." ;description
"Michael Terry" ;author
"copyright 1997, Michael Terry" ;copyright notice
"October 27, 1997" ;date created
"" ;image type that the script works on
SF-STRING "Text:" "Text Box" ;a string variable
SF-FONT "Font:" "Charter" ;a font variable
SF-ADJUSTMENT "Font size" '(50 1 1000 1 10 0 1)
;a spin-button
SF-COLOR "Color:" '(0 0 0) ;color variable
SF-ADJUSTMENT "Buffer amount" '(35 0 100 1 10 1 0)
;a slider
)
(script-fu-menu-register "script-fu-text-box" "<Toolbox>/Xtns/Script-
Fu/Text")
.ll &e4re doing here is setting the buffer based on the height of the te+t, and adding it
t&ice to both the height and &idth of our ne& image" 75e add it t&ice to both dimensions
because the buffer needs to be added to both sides of the te+t"8
No& that &e ha$e resi>ed the image to allo& for a buffer, &e need to center the te+t
&ithin the image" *his is done by mo$ing it to the 7+, y8 coordinates of 7theBuffer,
theBuffer8" I added this line after resi>ing the layer and the image=
(gimp-layer-set-offsets theText theBuffer theBuffer)
Go ahead and sa$e your script, and try it out after refreshing the database"
.ll that is left to do is return our image, the layer, and the te+t layer" .fter displaying the
image, &e add this line=
(list theImage theLayer theText)
*his is the last line of the function, ma-ing this list a$ailable to other scripts that &ant to
use it"
*o use our ne& te+t bo+ script in another script, &e could &rite something li-e the
follo&ing=
(set! theResult (script-fu-text-box
"Some text"
"Charter" "30"
'(0 0 0)
"35"
)
)
(gimp-image-flatten (car theResult))