home *** CD-ROM | disk | FTP | other *** search
- /* Personal Paint Amiga Rexx script - Copyright © 1995-1996 Cloanto Italia srl */
-
- /* $VER: AnimToFrames.pprx 1.1 */
-
- /** ENG
- This script converts the current animation into separate frames, creating
- a file for each frame. A three-digit suffix after the user-specified
- file name indicates the position of each frame in the animation, starting
- from frame 1. For example, if the name "Animation" is selected, the first
- frame will be saved as "Animation.001".
- */
-
- /** DEU
- Dieses Skript wandelt die aktuelle Animation in Einzelbilder um, wobei
- für jedes Bild eine eigene Datei erstellt wird. Die Position eines
- Bildes innerhalb der Gesamtanimation wird durch eine dreistellige
- Dateiendung wiedergegeben, beginnend mit Bild 1. Beispiel: Wird als
- Name "Animation" festgelegt, so erhält das als erstes gespeicherte
- Einzelbild den Dateinamen "Animation.001".
- */
-
- IF ARG(1, EXISTS) THEN
- PARSE ARG PPPORT
- ELSE
- PPPORT = 'PPAINT'
-
- IF ~SHOW('P', PPPORT) THEN DO
- IF EXISTS('PPaint:PPaint') THEN DO
- ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
- DO 30 WHILE ~SHOW('P',PPPORT)
- ADDRESS COMMAND 'Wait >NIL: 1 SEC'
- END
- END
- ELSE DO
- SAY "Personal Paint could not be loaded."
- EXIT 10
- END
- END
-
- IF ~SHOW('P', PPPORT) THEN DO
- SAY 'Personal Paint Rexx port could not be opened'
- EXIT 10
- END
-
- ADDRESS VALUE PPPORT
- OPTIONS RESULTS
- OPTIONS FAILAT 10000
-
- Get 'LANG'
- IF RESULT = 1 THEN DO /* Deutsch */
- txt_req_load = 'Animation auswählen'
- txt_req_sel = 'Format und Namensstamm auswählen'
- txt_err_abort = 'Speichervorgang wurde abgebrochen'
- txt_err_save = 'Fehler beim Speichern: '
- txt_err_oldclient = 'Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
- END
- ELSE IF RESULT = 2 THEN DO /* Italiano */
- txt_req_load = 'Selezionare animazione'
- txt_req_sel = 'Selezionare formato e nome'
- txt_err_abort = 'Operazione annullata'
- txt_err_save = 'Errore nella scrittura: '
- txt_err_oldclient = 'Questa procedura richiede_una versione più recente_di Personal Paint'
- END
- ELSE DO /* English */
- txt_req_load = 'Select Animation'
- txt_req_sel = 'Select Format and Root Name'
- txt_err_abort = 'User abort during save'
- txt_err_save = 'Error during save: '
- txt_err_oldclient = 'This script requires a newer_version of Personal Paint'
- END
-
- Version 'REXX'
- IF RESULT < 7 THEN DO
- RequestNotify 'PROMPT "'txt_err_oldclient'"'
- EXIT 10
- END
-
- LockGUI
- GetFrames
- frames = RESULT
- IF frames = 0 THEN DO
- RequestFile '"'txt_req_load'"'
- IF RC = 0 THEN DO
- LoadAnimation RESULT 'NEW'
- GetFrames
- frames = RESULT
- END
- END
- IF frames > 0 THEN DO
- RequestFile '"'txt_req_sel'" SAVEMODE LISTFORMATS FORCE'
- IF RC = 0 THEN DO
- savedata = RESULT
- endf = INDEX(savedata, '"', 2)
- filename = SUBSTR(savedata, 2, endf - 2)
- filedata = SUBSTR(savedata, endf + 1)
- GetFramePosition
- savepos = RESULT
- errcode = 0
- SetFramePosition 1
- DO fnum = 1 TO frames
- fname = filename || "." || RIGHT(fnum, 3, "0")
- SaveImage '"'fname'"'filedata 'FORCE QUIET'
- IF RC ~= 0 THEN DO
- IF RC = 5 THEN
- errmess = txt_err_abort
- ELSE
- errmess = txt_err_save || RC
- errcode = RC
- LEAVE
- END
- SetFramePosition 'NEXT'
- END
- SetFramePosition savepos
-
- IF errcode > 0 THEN
- RequestNotify 'PROMPT "'errmess'"'
- END
- END
- UnlockGUI
-