home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 1996 July
/
AMIGA_1996_7.BIN
/
patches
/
pagestream
/
3.0cfupdate
/
macros.lha
/
SendtoPageLiner.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-12-20
|
3KB
|
107 lines
/* $VER: SendtoPageLiner.rexx 1.1 (20.12.94)
Copyright 1994 Soft-Logik Publishing Corporation
May not be distributed without Soft-Logik Publishing Corporation's express written permission */
OPTIONS RESULTS
TRACE OFF
/* Make sure rexx support is opened */
IF ~SHOW('L','rexxsupport.library') THEN
CALL ADDLIB('rexxsupport.library',0,-30)
ADDRESS 'PAGESTREAM'
/* If text is not selected, select the current article */
getcursor characterstart sID characterend eID
if sID=eID then 'selecttext all'
/* Export the article to a temp file */
'lockinterface true'
'exporttext file t:HotLinkedArticle filter ascii textcode PageStream status force'
/* Eventually will just make article external, but not this version */
/* 'editarticle external file t:HotLinkedArticle' */
'refresh wait'
/* set the default PageLiner path */
plpath='PageStream3:PageLiner'
preffile='PageStream3:SendtoPageLiner.prefs'
/* If PageLiner doesn't exist in the default path, check SendtoPageLiner.prefs */
if ~exists(plpath) then do
if open(.ifile, preffile, 'R') then do
plpath=readln(.ifile)
call close(.ifile)
askuser='no'
end
else do
askuser='yes'
end
/* If PageLiner doesn't exist in the set pref path, ask the user where it is */
if ~exists(plpath) | askuser='yes' then do
getfile TITLE "'Please locate PageLiner'" load path "'PageStream3:'" file 'PageLiner' posbutton 'Ok' negbutton 'Cancel'
if RC=10 then signal cancel
plpath=result
if open(.ifile, preffile, 'W') then do
call writeln(.ifile, plpath)
call close(.ifile)
end
end
end
/* Run PageLiner */
ADDRESS COMMAND
'run >nil:' PLpath
/* Wait until the ARexx port shows up */
do 20
if ~show(P, 'PAGELINER') then call delay(50)
end
/* If the ARexx port didn't show up, alert the user and exit */
if ~show(P, 'PAGELINER') then do
ADDRESS 'PAGESTREAM'
allocarexxrequester '"Send to Editor Error!"' 368 59
reqhandle=result
addarexxgadget reqhandle EXIT 286 42 70 label "_Exit"
Exithandle=result
addarexxgadget reqhandle TEXT 8 10 352 border none string "'PageLiner could not be started.'"
doarexxrequester reqhandle
freearexxrequester reqhandle
'refresh continue'
'lockinterface false'
EXIT
end
ADDRESS 'PAGELINER'
'open t:HotLinkedArticle'
/* Wait for the user to finish in PageLiner */
do forever
if show(P, 'PAGELINER') then call delay(50)
else signal update
end
/* Update PageStream and exit */
UPDATE:
ADDRESS 'PAGESTREAM'
'screentofront'
/* Eventually will just make article external, but not this version */
/* 'editarticle path t:HotLinkedArticle' */
/* 'editarticle internal' */
'inserttext file t:HotLinkedArticle filter ascii textcode PageStream'
/* deselect the text if rquired */
if sID=eID then selecttext none
signal cancel
CANCEL:
ADDRESS 'PAGESTREAM'
'refresh continue'
'lockinterface false'
ADDRESS COMMAND
'delete t:HotLinkedArticle'
EXIT