home *** CD-ROM | disk | FTP | other *** search
- /* $VER: SendtoPageLiner.rexx 1.5a (21.10.96)
- Copyright 1996 SoftLogik Publishing Corporation
- May not be distributed without SoftLogik 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'
-
- /* Get the start date and time info */
- sTemp = statef('t:HotLinkedArticle')
- Parse VAR sTemp dum dum dum dum iSDays iSMins iSTicks .
-
- '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||' PUBSCREEN=PAGESTREAM3'
-
- /* 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'
- 'cursor down'
-
- /* Wait for the user to finish in PageLiner */
- do forever
- if show(P, 'PAGELINER') then do
- 'getarticle t:hotlinkedarticle'
- if rc=0 then call delay(50)
- else signal update
- end
- else signal update
- end
-
- /* Update PageStream and exit */
- UPDATE:
- ADDRESS 'PAGESTREAM'
- 'screentofront'
- 'revealwindow current'
-
- /* Get the end date and time info */
- sTemp = statef('t:HotLinkedArticle')
- Parse VAR sTemp dum dum dum dum iEDays iEMins iETicks .
-
- /* If the article hasn't changed, don't update pgs */
- if iSDays=iEDays & iSMins=iEMins & iSTicks=iETicks then signal cancel
-
- 'inserttext file t:HotLinkedArticle filter ascii textcode PageStream convertquote false convertdash true'
-
- /* 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 >NIL:'
- EXIT
-