Framescript to remove all images (but leave the AFrames) SOLVED

2009-04-09 Thread Yves Barbion
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  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
>
>


Re: Framescript to remove all images (but leave the AFrames) SOLVED

2009-04-08 Thread Yves Barbion
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 muelle...@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


___


You are currently subscribed to Framers as arch...@mail-archive.com.

Send list messages to fram...@lists.frameusers.com.

To unsubscribe send a blank email to 
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.