Framescript to remove all images (but leave the AFrames) SOLVED
Yves Barbion
yves.barbion at gmail.com
Wed Apr 8 14:02:35 PDT 2009
Hi Klaus
Thank you very much. It works great!
IOU.
Cheers
--
Yves Barbion • Managing Director • Adobe-Certified FrameMaker Instructor
www.scripto.nu • skype: yves.barbion • T: +32 494 12 01 89
On Wed, Apr 8, 2009 at 7:54 PM, Klaus Mueller <mueller23 at web.de> wrote:
> 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< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>
>
> //-- 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
>
>
More information about the framers
mailing list