/* ---------------- Steuerdatei für ImageDesk ------------------- */ /* */ /* A U T O C A T */ /* */ /* AREXX-Script zur vollautomatisierten Steuerung von Katalogen */ /* 2. Teil: */ /* Steuerscript bei Klick auf Bild */ /* */ /* von Ulrich Röcher, roecher@fts.uni-siegen.de */ /* */ /*----------------------------------------------------------------*/ OPTIONS RESULTS if( ADDRESS() ~= "IDESK_REXXPORT" ) then ADDRESS IDESK_REXXPORT PARSE ARG iname itype /* -------------------------------------------------------------- */ CTYP=getclip('CTYP') /* stelle den Befehlsgrafik-Typ fest */ CDIR=getclip('CDIR') /* stelle das Befehlsdirectory fest */ Command=getclip('Command') /* stelle den richtigen Katalog fest */ if itype=CTYP then do /* Befehle ausführen */ if POS(".",iname)=0 then iname=iname||'.fehlerhaftes_AREXX' DO WHILE POS('/',iname)>0 iname=substr(iname,POS('/',iname)+1,length(iname)) end if POS(":",iname)>0 then iname=substr(iname,Pos(':',iname)+1,length(iname)) if POS(".",iname)>0 then iname=substr(iname,1,Pos(".",iname)-1) select when iname="Weiter" then do /* gehe zur nächsten Thumbnail-Seite */ ihvz=getclip('ihvz') ADIR=getclip('ADIR') MAXENTRY=getclip('MAXENTRY') Aktu=getclip('Aktu') AnzTN=getclip('AnzTN') CLEANDESK cat=CDIR||Command if CDIR=ADIR then do OPENCAT cat 1 1 end else do OPENCAT cat 1 2 end if pos("-",AnzTN)=0 then do AWert=AnzTN AnzTN="" end else do x=length(AnzTN) do until substr(AnzTN,x,1)="-" x=x-1 end tempx=substr(AnzTN,1,x-1) AWert=substr(AnzTN,x+1) AnzTN=tempx end istTN=Val(AWert) Lfd_Nr=2 AnzKats= words(ihvz) temp=2 DO until (Aktu>AnzKats) | (Lfd_Nr=(MAXENTRY-1)) name=ADIR||Word(ihvz,Aktu) OPENCAT name istTN+1 (MAXENTRY-1-Lfd_Nr) GETSYSINFO THUMBSUSED Lfd_Nr = RESULT kat=Lfd_Nr-temp+istTN if AnzTN="" then do AnzTN=CHR(kat) end else do AnzTN=AnzTN||"-"||CHR(kat) end temp=Lfd_Nr istTN=0 Aktu=Aktu+1 end if Lfd_Nr=MAXENTRY-1 then OPENCAT CDIR||Command 3 1 setclip('Aktu',Aktu-1) setclip('AnzTN',AnzTN) end when iname="Zurück" then do /* gehe zurück zur letzten Thumbnail-Seite */ ihvz=getclip('ihvz') ADIR=getclip('ADIR') MAXENTRY=getclip('MAXENTRY') Aktu=getclip('Aktu') AnzTN=getclip('AnzTN') x=length(AnzTN) Do while (substr(AnzTN,x,1)~="-") & (x~=0) x=x-1 end tempx=substr(AnzTN,1,x-1) AWert=substr(AnzTN,x+1,length(AnzTN)-x) AnzTN=tempx z=Val(AWert) Aktu=Aktu-1 GETSYSINFO THUMBSUSED IstTN = RESULT if IstTN=MAXENTRY then do IstTN=IstTN-3 end else do IstTN=IstTN-2 end halt=0 DO until halt=1 x=length(AnzTN) Ende=0 Do until (x<1) | (Ende=1) x=x-1 if x>0 then do if (substr(AnzTN,x,1)="-") then Ende=1 end end if x=0 then do AWert=AnzTN AnzTN="" end else do tempx=substr(AnzTN,1,x-1) AWert=substr(AnzTN,x+1,length(AnzTN)-x) AnzTN=tempx end Aktu=Aktu-1 aw=Val(AWert) z=z+aw if z>(IstTN+MAXENTRY-3) then halt=1 end z=z-(IstTN+MAXENTRY-3) Aktu=Aktu+1 if (AnzTN="") & (z>1) then do Anfang=0 end else do Anfang=1 end CLEANDESK cat=CDIR||Command if (Aktu=1) & (Anfang=1) then do /* am Anfang, lädt nur hoch */ if CDIR=ADIR then do nop end else do OPENCAT cat 2 1 end afg=0 z=1 Lfd_Nr=1 end else do if CDIR=ADIR then do OPENCAT cat 2 1 end else do OPENCAT cat 1 2 end afg=1 Lfd_Nr=2 end istTN=z AnzKats= words(ihvz) temp=2 DO until (Aktu=AnzKats+1) | (Lfd_Nr=(MAXENTRY-1)) name=ADIR||Word(ihvz,Aktu) OPENCAT name (istTN+afg) (MAXENTRY-1-Lfd_Nr) GETSYSINFO THUMBSUSED Lfd_Nr = RESULT if afg=0 then afg=1 kat=Lfd_Nr-temp+istTN if AnzTN="" then do AnzTN=CHR(kat) end else do AnzTN=AnzTN||"-"||CHR(kat) end temp=Lfd_Nr istTN=0 Aktu=Aktu+1 end if Lfd_Nr=MAXENTRY-1 then OPENCAT CDIR||Command 3 1 setclip('Aktu',Aktu-1) setclip('AnzTN',AnzTN) end when iname="Hoch" then do ADIR=getclip('ADIR') MAXENTRY=getclip('MAXENTRY') do x=(length(ADIR)-1) to 1 by -1 if substr(ADIR,x,1)='/' then do ADIR=substr(ADIR,1,x) leave end if substr(ADIR,x,1)=':' then do ADIR=substr(ADIR,1,x) leave end end setclip('ADIR',ADIR) adress command 'cd 'ADIR CLEANDESK if ADIR=CDIR then do /* Kommando-Verzeichnis */ x=1 y=0 ihvz="" do until x=0 if y>0 then do wx=CHR(y) if pos("0",wx)=1 then wx=substr(wx,2,length(wx)-1) erg="."||wx end else do erg="" end name="Head.cat"||erg name1=CDIR||name if exists(name1) then do if ihvz~="" then ihvz=ihvz||" " ihvz=ihvz||name x=1 end else do x=0 end y=y+1 end setclip('ihvz',ihvz) end else do /* nur ein Verzeichnis hoch */ setclip("ADIR",ADIR) adress command 'cd 'ADIR fl=SHOWDIR(ADIR,'File') IF fl='' then DO ERRORMSG '"Fehlerhafter Directoryeintrag"' exit end /* Hier Sortierroutine */ IF fl~='' THEN DO fl=translate(fl,' ','"') fl=UPPER(fl) fl2='' DO i=1 TO WORDS(fl) Buff=WORD(fl,1) Delli=1 DO j=1 TO WORDS(fl) IF WORD(fl,j)