home *** CD-ROM | disk | FTP | other *** search
- /*
-
- changcap.cwx
-
- This script should interate through a project and change captions
- found that are one string to another string.
-
- You must edit the script to change the "From" and "TO" variables to
- use.
-
- Copyright 1997 by TrueSpectra Inc.
-
- This code is provided purely for demonstration purposes and is not
- supported or under warranty. Feel free to modify and examine this
- example script for your own purposes.
-
- */
-
- /* Load utility functions. */
- call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
- call SysLoadFuncs
-
- /* FROM to TO change these to whatever values you want */
- FROM = "WORD"
- TO = "TWO WORDS"
-
- /* Make sure the user wants to do this. */
- if RxMessageBox("Do you wish to change all the text" FROM " to " TO,"Settings","yesno") \= 6 then exit;
-
- call text CwGetCurrentView(), FROM, TO
- exit
-
- text:procedure
- parse arg root, FROM, TO
-
- object = CwFindFirstObject(root)
-
- do while CwIsHandleValid(object)
-
- ht = CwGetHandleType(object)
- if \(ht = "Group") then
- do
- region = CwGetRegion(object)
-
- if CwHasProperty(region, "Caption") then
- do
- caption = CwGetProperty( region, "Caption")
- say caption"."
- say FROM"."
- if caption = FROM then
- do
- say caption
- call CwSetProperty region, "Caption", TO
- end
- end
- end
- object = CwFindNextObject(object)
- end
- return
-
-