home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 1996 July
/
AMIGA_1996_7.BIN
/
patches
/
pagestream
/
3.0cfupdate
/
macros.lha
/
SendtoBME.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-11-17
|
4KB
|
124 lines
/* $VER: SendtoBME.rexx 1.0c (17.11.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'
/* Check and see if one picture is selected */
getobject type objtype
if objtype~=12 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 "'One picture must be selected to edit in BME.'"
addarexxgadget reqhandle TEXT 8 20 352 border none string "'Select only one picture and try again.'"
doarexxrequester reqhandle
freearexxrequester reqhandle
EXIT
end
/* Export the picture to a temp file */
'lockinterface true'
'exportgraphic file t:HotLinkedPicture filter iffilbm status force'
/* Eventually will just make picture external, but not this version */
/* 'editpicture external file t:HotLinkedPicture' */
'refresh wait'
/* set the default BME path */
bmepath='PageStream3:BME'
preffile='PageStream3:SendtoBME.prefs'
/* If BME doesn't exist in the default path, check SendtoBME.prefs */
if ~exists(bmepath) then do
if open(.ifile, preffile, 'R') then do
bmepath=readln(.ifile)
call close(.ifile)
askuser='no'
end
else do
askuser='yes'
end
/* If BME doesn't exist in the set pref path, ask the user where it is */
if ~exists(bmepath) | askuser='yes' then do
getfile TITLE "'Please locate BME'" load path "'PageStream3:'" file BME posbutton 'Ok' negbutton 'Cancel'
if RC=10 then signal cancel
bmepath=result
if open(.ifile, preffile, 'W') then do
call writeln(.ifile, bmepath)
call close(.ifile)
end
end
end
/* Run BME */
ADDRESS COMMAND
'run >nil:' bmepath
/* Wait until the ARexx port shows up */
do 20
if ~show(P, 'BME') then call delay(50)
end
/* If the ARexx port didn't show up, alert the user and exit */
if ~show(P, 'BME') 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 "'BME could not be started.'"
doarexxrequester reqhandle
freearexxrequester reqhandle
'refresh continue'
'lockinterface false'
EXIT
end
ADDRESS 'BME'
'screentofront'
'open t:HotLinkedPicture'
/* While the user is in BME, let's get some info about the pic from PageStream */
ADDRESS 'PAGESTREAM'
getpicture position pstem frame fflag contentoffset cstem contentscale cstem rotation rstem about rstem constrain cflag print pflag
gettextwrap region wmode wrap wtype standoff wstem
/* Wait for the user to finish in BME */
do forever
if show(P, 'BME') then call delay(50)
else signal update
end
/* update pgs and exit */
UPDATE:
ADDRESS 'PAGESTREAM'
'screentofront'
/* Eventually will just make picture external, but not this version */
/* 'editpicture path t:HotLinkedPicture' */
/* 'editpicture internal' */
'deleteobject'
'placegraphic file t:HotLinkedPicture filter iffilbm'
editpicture position pstem.left pstem.top pstem.right pstem.bottom skew rstem.slant rstem.twist
if fflag=ON then editpicture framed contentoffset cstem.x cstem.y contentscale cstem.h cstem.v
settextwrap wmode standoff wstem.x wstem.y wtype
signal cancel
CANCEL:
ADDRESS 'PAGESTREAM'
'refresh continue'
'lockinterface false'
ADDRESS COMMAND
'delete t:HotLinkedPicture'
EXIT