home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
vtdicons.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-01-26
|
11KB
|
329 lines
/*****************************************************************************/
/* VTDICONS.CMD */
/* Create desktop Icons for VTD for OS/2 and each Users present Statistics, */
/* except for SIP */
/* Origianlly creator: Frank Adams - October 25, 1994 */
/* Enhancements by: Dharmesh Bhakta - March 15, 1994 */
/*****************************************************************************/
Trace '0'
Address CMD
'@ECHO OFF'
Signal On Halt
Signal On Syntax
/**************/
/* Initialize */
/**************/
Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
Call SysLoadFuncs
/***********************/
/* Display Header info */
/***********************/
cls
Say ' IBM VoiceType Dictation System Folder & Icon creator '
Say ' '
Say ' This REXX program will recreate the IBM VoiceType Dictation System folder'
Say 'and all of the icons within. Once the standard icons have been created,'
Say 'you will be asked if you would like to recreate all of the User icons.'
Say 'If you choose to continue, you have the option of recreating icons for each'
Say "user that has enrolled or installed his or her's speaker model statistics"
Say 'on this system. Also, as an added bonus, this program will prompt you'
Say 'before creating icons for each vocabulary for each user. For example, if'
Say 'you also have the Radiology vocabulary installed along with the standard'
Say 'vocabulary that comes with the product, this program will create icons'
Say 'for each vocabulary for you. Thus, you should have two icons in your IBM'
Say 'VoiceType Dictation System folder that will automatically start the vocabulary'
Say 'of your choice.'
Say ' '
'PAUSE'
/***********************/
/* Verify REXX version */
/***********************/
Parse Version v
v = Translate(Word(v,5)||Right(Wordpos(Word(v,4),'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'),2)||Right(Word(v,3),2),'0',' ')
If v < 19920708 Then Do
Say "The version of REXX on your system is backlevel."
Say " "
Say "Please update your REXX level code to version 2.0."
Say "To end this process, kill the OS/2 session. If you wish to continue"
Say "then press any other key. Your icons may not be created beacuse of"
Say "this back level code!"
'PAUSE'
End
/*****************************/
/* Get TangLite Drive Letter */
/*****************************/
SPCH_DRV = value('SPCH_DRIVE',,'OS2ENVIRONMENT')
/**********************************/
/* CREATE TANGLITE FOLDER & ICONS */
/**********************************/
cls
/**************************************************/
/** CREATE "IBM Personal Dictation System" FOLDER */
/**************************************************/
thing = 'IBM VoiceType Dictation System folder'
classname = 'WPFolder'
title = 'IBM VoiceType Dictation System'
location = '<WP_DESKTOP>'
setup = 'OBJECTID=<TANGLITE>;'||,
'ICONFILE='SPCH_DRV'\SPCH_RO\BIN\IPDS_US.ICO;'
result = SysCreateObject(classname, title, location, setup, 'r')
Call Check_Result
/**************************************/
/** CREATE "Check Installation" ICON **/
/**************************************/
thing = 'Check Installation icon'
classname = 'WPProgram'
title = 'Check Installation'
location = '<TANGLITE>'
setup = 'OBJECTID=<CHKINST>;'||,
'EXENAME='SPCH_DRV'\SPCH_RO\BIN\CHKINST.EXE;'||,
'PARAMETERS=-l En_US -u sip -e isob571 -d walkupus;'||,
'STARTUPDIR='SPCH_DRV'\SPCH_RUN;'||,
'PROGTYPE=PM;'
result = SysCreateObject(classname, title, location, setup, 'r')
Call Check_Result
/****************************/
/** CREATE "Tutorial" ICON **/
/****************************/
thing = 'Tutorial icon'
classname = 'WPProgram'
title = 'Tutorial'
location = '<TANGLITE>'
setup = 'OBJECTID=<SPTUTOR>;'||,
'EXENAME='SPCH_DRV'\SPCH_RO\BIN\SPTUTOR.EXE;'||,
'PARAMETERS=-L En_US;'||,
'STARTUPDIR='SPCH_DRV'\SPCH_RUN;'||,
'PROGTYPE=PM;'
result = SysCreateObject(classname, title, location, setup, 'r')
Call Check_Result
/*******************************/
/** CREATE "Speech Games" ICON */
/*******************************/
thing = 'Speech Games icon'
classname = 'WPProgram'
title = 'Speech Games'
location = '<TANGLITE>'
setup = 'OBJECTID=<GAMES>;'||,
'EXENAME='SPCH_DRV'\SPCH_RO\BIN\GAMES.EXE;'||,
'STARTUPDIR='SPCH_DRV'\SPCH_RUN;'||,
'PROGTYPE=PM;'
result = SysCreateObject(classname, title, location, setup, 'r')
Call Check_Result
/*****************************/
/** CREATE "Enrollment" ICON */
/*****************************/
thing = 'Enrollment icon'
classname = 'WPProgram'
title = 'Enrollment'
location = '<TANGLITE>'
setup = 'OBJECTID=<ENROLL>;'||,
'EXENAME='SPCH_DRV'\SPCH_RO\BIN\ENROLL.EXE;'||,
'PARAMETERS=-L En_US;'||,
'STARTUPDIR='SPCH_DRV'\SPCH_RUN;'||,
'PROGTYPE=PM;'
result = SysCreateObject(classname, title, location, setup, 'r')
Call Check_Result
/*****************************************/
/** CREATE "Voice Manager Settings" ICON */
/*****************************************/
thing = 'Voice Manager Settings icon'
classname = 'SPEECHWP'
title = 'Voice Manager^Settings'
location = '<WP_DESKTOP>'
setup = 'OBJECTID=<SMAUDIO>;'
result = SysCreateObject(classname, title, location, setup, 'r')
Call Check_Result
'PAUSE'
/****************************/
/* Check for Speaker Models */
/****************************/
call SysFileTree SPCH_DRV'\spch_rw\users\*.*', 'users', 'D'
if users.0 = 0 then do
say "There appears to be no user statistics installed." users.0
exit(-1)
end /* Do */
call SysFileTree SPCH_DRV'\spch_ro\langs\En_US\tasks\*.*', 'domains', 'D'
if domains.0 = 0 then do
say "There appears to be no domains (vocabularies) installed." domains.0
exit(-1)
end /* Do */
/************************************/
/* Prompt User to create User Icons */
/************************************/
cls
Say 'Would you like for me to recreate all of the User Icons (Y/N)'
pull answer
if answer = "Y" | answer = "y" then do
exist=stream(SPCH_DRV'\SPCH_RO\BIN\SMARTMIC.ICO','c','query exists')
if exists = "" then do
say SPCH_DRV'\SPCH_RO\BIN\SMARTMIC.ICO' 'icon not found.'
exit(-2)
end /* Do */
do i=1 to users.0 by 1
parse var users.i . . . . dirspec .
dir_name=filespec('name',dirspec)
if translate(dir_name) <> 'SIP' then do
objectid = "TANGLITE"||i
call SysFileTree dirspec"\*.uid", 'uid', 'F'
if uid.0 = 0 | uid.0 > 1 then do
say "There is either no *.uid or more than one *.uid file, exit." uid.0
exit(-3)
end /* Do */
parse var uid.1 . . . . uid_file .
do until lines(uid_file) = 0
cur_line=linein(uid_file)
parse var cur_line name equal full_name
if substr(name,2) = "Name" then leave /*get rid of weird x'09' */
end /* do until uid eof */
call SysFileTree dirspec"\*.eid", 'eid', 'F'
if eid.0 = 0 | eid.0 > 1 then do
say "There is either no *.eid or more than one *.eid file, exit." eid.0
exit(-3)
end /* Do */
parse var eid.1 . . . . eid_file .
eid_name=filespec('name',eid_file)
parse var eid_name enroll_id '.' .
cls
new_domain = ''
Title =full_name
SETUP1 ='OBJECTID=<'objectid'>;EXENAME='SPCH_DRV'\SPCH_RO\BIN\WW.EXE;'
SETUP3 ='PARAMETERS=-d startus -e 'enroll_id '-u 'dir_name '-L En_US;'
call User_Icon
parse var domains.i . . . . dirspec .
dir_name=filespec('name',dirspec)
call SysFileTree dirspec"\*.tid", 'tid', 'F'
do x=1 to tid.0 by 1
parse var tid.x . . . . tid_file
vocab_name=filespec('name',tid_file)
parse var vocab_name domain '.' .
objectid = full_name domain
if domain \= "enroll" ^ domain \= "startus" ^ domain \= "walkup" then do
call Real_Domains
Say ' '
Say "Would you like "full_name"'s "new_domain" vocabulary icon created (y/n)?"
pull answer2
if answer2 = "Y" | answer2 = 'y' then do
Title =full_name||'0a'x||new_domain
SETUP1 ='OBJECTID=<'objectid'>;EXENAME='SPCH_DRV'\SPCH_RO\BIN\WW.EXE;'
SETUP3 ='PARAMETERS=-d 'domain' -e 'enroll_id '-u 'dir_name '-L En_US;'
call User_Icon
end /* end do answer2 */
domain = ''
Say ' '
end /* end do domain */
end /* end do x */
'PAUSE'
end /* Do if dir_name */
end /* do users.i*/
end
else
call Endit
/****************/
/* EXIT PROGRAM */
/****************/
Endit:
do
cls
Say "Thanks for using TANGICON.CMD! Have a Grrrreeaaatt DAY!!"
Say " "
end
Exit 0
/*********************/
/* CREATE USER_ICONS */
/*********************/
User_Icon:
ClassName='WPProgram'
Location ='<TANGLITE>'
SETUP2 ='STARTUPDIR='SPCH_DRV'\SPCH_RUN;'
SETUP4 ='ICONFILE='SPCH_DRV'\SPCH_RO\BIN\SMARTMIC.ICO;'
RC=SysCreateObject(ClassName,Title,Location,SETUP1||SETUP2||SETUP3||SETUP4,'R')
IF RC <> 1 THEN
Say 'Speaker Model icon "'full_name new_domain'" already exists! Sorry not created!'
ELSE
Say 'Speaker Model icon "'full_name new_domain'" created successfully!'
return
/*******************/
/* INFORM THE USER */
/*******************/
Check_Result:
If result = 1 then do
Say 'The 'thing' has been created successfully!'
Say ' '
END
else do
Say 'The 'thing' already exists! Sorry not created!'
Say ' '
End
return
/***************************/
/* ASSIGN REAL VOCAB NAMES */
/***************************/
Real_Domains:
if domain = 'rad' then new_domain = 'Radiology'
if domain = 'news' then new_domain = 'Journalism'
if domain = 'em' then new_domain = 'Emergency Medicine'
return
/*************************/
/* HANDLE SIGNAL ON HALT */
/*************************/
Halt:
Say 'A Halt condition was raised on line' sig1'!'
problem_line = sigl
Signal Abnormal_End
/***************************/
/* HANDLE SIGNAL ON SYNTAX */
/***************************/
Syntax:
Say 'A SYNTAX condition was raised on line' sigl'!'
Say ' The error number is' rc', which means "'Errortext(rc)'"'
problem_line=sigl
Signal Abnormal_End
/****************/
/* Abnormal End */
/****************/
Abnormal_End:
Say ' That line is "'Sourceline(problem_line)'"'
Exit