home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 1996 July
/
AMIGA_1996_7.BIN
/
patches
/
pagestream
/
3.0iupdate
/
macros.lha
/
SendtoProVector.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-07-13
|
5KB
|
168 lines
/* $VER: SendtoProVector.rexx 1.0 (07.07.95)
Based on "SendtoBME.rexx"
Modified for ProVector® by Jeff Blume - Stylus, Inc.
"SendtoBME.rexx" Copyright 1995 Soft-Logik Publishing Corporation
May not be distributed without Soft-Logik Publishing Corporation's express written permission.
Permission is granted to include this script with ProVector.
*/
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 drawing is selected */
getobject type objtype
if objtype~=2 then do
ADDRESS 'PAGESTREAM'
allocarexxrequester '"Send to ProVector 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 drawing must be selected to edit in ProVector.'"
addarexxgadget reqhandle TEXT 8 20 352 border none string "'Select only one drawing and try again.'"
doarexxrequester reqhandle
freearexxrequester reqhandle
EXIT
end
/* Export the drawing to a temp file */
'lockinterface true'
'exportgraphic file t:HotLinkedDrawing filter iffdr2d status force'
/* Eventually will just make drawing external, but not this version */
/* 'editpicture external file t:HotLinkedDrawing' */
'refresh wait'
/* set the default ProVector path */
call pragma('W', 'Null') /* So DOS requester suppressed, sans PV: assignment */
PVpath='PV:ProVector'
preffile='PageStream3:SendtoProVector.prefs'
/* If ProVector doesn't exist in the default path, check SendtoProVector.prefs */
if ~exists(PVpath) then do
if open(.ifile, preffile, 'R') then do
PVpath=readln(.ifile)
call close(.ifile)
askuser='no'
end
else do
askuser='yes'
end
/* If ProVector doesn't exist in the set pref path, ask the user where it is */
if ~exists(PVpath) | askuser='yes' then do
getfile TITLE "'Please locate ProVector'" load path "'PageStream3:'" file ProVector posbutton 'Ok' negbutton 'Cancel'
if RC=10 then signal cancel
PVpath=result
if open(.ifile, preffile, 'W') then do
call writeln(.ifile, PVpath)
call close(.ifile)
end
end
end
/* Run ProVector after setting path to ProVector path for PROGDIR: references */
FNameIdx = LastPos("/",PVPath) /* Index to simple filename */
if FNameIdx = 0 then FNameIdx = lastpos(":",PVPath)
PVDir = Left(PVPath,(FNameIdx -1))
call Pragma('D',PVDir)
call Pragma('S',8000)
if ~show(P, 'ProVector') then ADDRESS COMMAND 'run >nil:' PVpath "AskRes=False"
/* Wait until the ARexx port shows up */
do 20
if ~show(P, 'ProVector') then call delay(50)
end
/* If the ARexx port didn't show up, alert the user and exit */
if ~show(P, 'ProVector') 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 "'ProVector could not be started.'"
doarexxrequester reqhandle
freearexxrequester reqhandle
'refresh continue'
'lockinterface false'
EXIT
end
/* Obviously, this won't always go to the ProVector screen, but since 'screentofront'
has no equivalent in ProVector... (yes, there should be - JB) */
'ScreenToBack'
ADDRESS 'ProVector'
'Lock Wait'
'Open T:HotLinkedDrawing'
'GetBool "Save & close to update PageStream." "OK" "OK"'
'UnLock'
/* While the user is in ProVector, 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 ProVector */
ADDRESS 'ProVector'
do forever
if ~show(P, 'ProVector') then signal update
if GetDrawing() 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:HotLinkedDrawing' */
/* 'editpicture internal' */
'deleteobject'
'placegraphic file T:HotLinkedDrawing filter IFFDR2D'
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
/* Next clause not really needed, since UpDate has no return statement */
signal cancel
CANCEL:
ADDRESS 'PAGESTREAM'
'refresh continue'
'lockinterface false'
ADDRESS COMMAND
'delete T:HotLinkedDrawing'
EXIT
GETDRAWING:
/* See if user still has drawing open */
'Lock'; if RC ~= 0 then return 1
'FirstProj'; ProjPtr = Result
'ProjName' ProjPtr
if Result = "T:HOTLINKEDDRAWING" then do
'UnLock'
return 1
end
else do i=1
'NextProj' ProjPtr
if Result = 0 then do
'UnLock'
return 0
end
ProjPtr = Result
'ProjName' ProjPtr
if Result = "T:HOTLINKEDDRAWING" then do
'UnLock'
return 1
end
end
'UnLock'
return