home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The AGA Experience 2
/
agavol2.iso
/
software
/
utilities
/
comms
/
voodoo
/
contrib
/
convertaliases
/
convpinealiases.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-12-12
|
2KB
|
91 lines
/*
ConvPineAliases 1.0 by Sami Itkonen
Based on ConvertAliases by Dan Fraser
Converts (unix) pine addressbook file to voodoo
*/
parse arg infile outfile
if infile='' then do
wbmode=1
address command 'requestchoice >nil: title="ConvPineAliases" body="Welcome to ConvPineAlias 1.0 by Sami Itkonen" gadgets="OK"'
infile=requestfile('Select Pine ''addressbook'' file...','file=.addressbook drawer=uulib:')
if infile='' then do
call info('Aborted!')
exit 5
end
end
else wbmode=0
if ~open(aliasfile,infile,'R') then do
call info('Can''t open the input file. odd.')
exit 5
end
if outfile='' then do
outfile=requestfile('Select your ''Voodoo.aliases'' file...')
if outfile='' then do
call info('Aborted!')
exit 5
end
end
outfile=strip(outfile)
if open(Valiases,outfile,'A') then do
do while ~eof(aliasfile)
inline=readln(aliasfile)
if (left(inline,1)~='#') & (inline~='') then do
parse var inline alias ' ' name ' ' email
if lastpos(")",email) ~= 0 then parse var email '('email')'
say lastpos('@',email)
call writeln(Valiases,strip(alias)': 'strip(email)' ; "'strip(name)'" 0')
end
end
call info('Done! Thanks for using ConvPineAliases.rexx!')
end
else
call info('unable to open output file for some reason. odd.')
exit 0
requestfile:procedure
parse arg title,moreopts
address command 'requestfile >pipe:filename title="'title'" 'moreopts
if open(pipefile,'pipe:filename','R') then do
inline=readln(pipefile)
call close(pipefile)
end
else do
say 'fatal error, problem making requester'
exit 10;
end
return strip(inline,'B','"')
request:procedure expose wbmode
if wbmode=1 then do
parse arg title,body,defdir
address command 'requestchoice >pipe:filename title="'title'" body="'body'" gadgets="Yes" "No"'
if open(pipefile,'pipe:filename','R') then do
inline=readln(pipefile)
call close(pipefile)
end
else do
say 'fatal error, problem making requester'
exit 10;
end
end
else inline=1
return inline
info:procedure expose wbmode
parse arg body
if wbmode=1 then
address command 'requestchoice >nil: title="Info" body="'body'" gadgets="oh"'
else
say body
return 0