Framescript to remove all images (but leave the AFrames)

Klaus Mueller mueller23 at web.de
Wed Apr 8 10:54:48 PDT 2009


Hello Yves,

> Does anyone have a Framescript he/she wishes to
> share which removes all images from the frames,
> but which also leaves the AFrames intact?

Find attached the script RemoveGraphicInsets.fsl
that removes all copied graphics from the current
document.
Optionally it deletes also referenced graphics.
(-> Set gvRemoveReferencedGraphics = True;)

Kind regards,
Klaus


snip  8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

//-- Removes graphics from the current doc.
//-- v0.1, 2009-04-08
//-- Klaus Müller, itl AG

//-- Remove not only copied insets,
//-- but also referenced graphics:
Set gvRemoveReferencedGraphics = False;

Set gvDoc = ActiveDoc;
If (not gvDoc) LeaveSub; EndIf

//-- Collect graphic insets:
New IntList NewVar(lvInsetObjList);
Set lvGraphic = gvDoc.FirstGraphicInDoc;
Loop While(lvGraphic)
  If (lvGraphic.ObjectName = 'Inset')
    If (lvGraphic.InsetFile = '' or gvRemoveReferencedGraphics)
      New Integer Value(lvGraphic) NewVar(lvInt);
      Add Member(lvInt) To(lvInsetObjList);
    EndIf
  EndIf
  Set lvGraphic = lvGraphic.NextGraphicInDoc;
EndLoop

//-- No graphics ...
If (lvInsetObjList.Count = 0)
  If (gvRemoveReferencedGraphics)
    Display 'No graphics found.';
  Else
    Display 'No copied graphics found.';
  EndIf
  LeaveSub;
EndIf

//-- Really?
MsgBox 'Remove '+lvInsetObjList.Count+' graphics '+
  'from the current document?' Button(lvButton) Mode(YesNo);
If (lvButton = NoButton) LeaveSub; EndIf

//-- Delete graphics:
Loop While(lvi <= lvInsetObjList.Count) LoopVar(lvi) InitVal(1) Incr(1)
  Get Member Number(lvi) From(lvInsetObjList) NewVar(lvInt);
  New Object IntValue(lvInt) DocObject(gvDoc) NewVar(lvGraphic);
  Delete Object(lvGraphic);
EndLoop

snip  8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: RemoveGraphicInsets.fsl
URL: <http://lists.frameusers.com/pipermail/framers-frameusers.com/attachments/20090408/25c76c79/attachment.asc>


More information about the framers mailing list