[CS2][JS] How to scale all inline images to 70%

To all the script gurus out there. can you help me make a script that scale all inline images to 70%? 'coz we got this client and they supply us with lots of eps files then the instruction would be to reduce the size of all images without touching the original ones. it takes time to process all of them in indesign manually.
help please.

Thank you so much guys. I'll try it later. Although I have one more problem. I got this LabelGraphics script from Indesignsecret.com modified for CS2 (originally from CS3), and it works fine for displayed figures but for inline it only labels the figures in first page.
here's the code:
//LabelGraphics.jsx
main();
//=============================================================\\
function main(){
if(app.documents.length != 0){
if(app.documents.item(0).allGraphics.length != 0){
myDisplayDialog();
else{
alert("Document contains no graphics.");
else{
alert("Please open a document and try again.");
//=============================================================\\
function myDisplayDialog(){
var myLabelWidth = 100;
var myStyleNames = myGetParagraphStyleNames();
var myDialog = app.dialogs.add({name:"Graphics name"});
with(myDialog.dialogColumns.add()){
//Label type
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author","Paste from clipboard"], selectedIndex:0});
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelOffsetField = measurementEditboxes.add({editValue:0});
//Style to apply
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:4});
//=============================================================\\
var myResult = myDialog.show();
if(myResult == true){
var myLabelType = myLabelTypeDropdown.selectedIndex;
var myLabelHeight = 24; // A generic label height that will be adjusted later
myPasteFailure = false;
var myLabelOffset = myLabelOffsetField.editValue;
var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
myDialog.destroy();
var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
try{
myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
catch(e){
alert("Unable to add lables. " + e);
try{
resizeOverset() ;
catch(e){
alert("Unable to correct overset text. " + e);
if (myPasteFailure == true){
alert("Unable to paste from clipboard.");
app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
else{
myDialog.destroy();
//=============================================================\\
function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName){
var myDocument = app.documents.item(0);
myStoriesArray = new Array();
if (app.selection.length == 0) // If nothing is selected apply caption to all graphics in the document
var myConfirmation = confirm("Add captions to all images in the document?", false, "LabelGraphics.jsx" );
if (myConfirmation == true)
var myGraphics = myDocument.allGraphics;
else
{ // If graphics are selected, just add captions to the selected items, as long as they are rectangles(image frames)
var myConfirmation = true;
var mySelections = app.selection;
myGraphics = new Array();
for(i = 0; i < mySelections.length; i++){
if(mySelections[i] == "[object Rectangle]"){ //Check to make sure selection only includes rectangles
myGraphics.push(mySelections[i].allGraphics[0]);
else{
//alert("Objects other than graphics were selected!");
//Nothing happens if you don't select at least one graphic
myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
if (myConfirmation == true){
for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
try{
myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myStoriesArray);
catch(e){};
//=============================================================\\
function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myStoriesArray){
var myLabel;
var myLink = myGraphic.itemLink;
var myPasteFromClipboard = false;
//Create the label layer if it does not already exist.
var myLabelLayer = myDocument.layers.item("Grapiks");
try{
myLabelLayer.name;
catch (myError){
myLabelLayer = myDocument.layers.add({name:"Grapiks"});
//Label type defines the text that goes in the label.
switch(myLabelType){
//File name
case 0:
myLabel = myLink.name;
break;
//File path
case 1:
myLabel = myLink.filePath;
break;
//XMP description
case 2:
try{
myLabel = myLink.linkXmp.description;
catch(myError){
myLabel = "No description available.";
break;
//XMP author
case 3:
try{
myLabel = myLink.linkXmp.author
catch(myError){
myLabel = "No author available.";
break;
//Paste from the clipboard
case 4:
try{
myPasteFromClipboard = true;
catch(myError){
myLabel = "No clipboard data available.";
break;
var myFrame = myGraphic.parent;
myX1 = myFrame.geometricBounds[1];
myY1 = myFrame.geometricBounds[2] + myLabelOffset;
myX2 = myFrame.geometricBounds[3];
myY2 = myY1 + myLabelHeight;
if (myPasteFromClipboard ==true)
try{
var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2]});
myTextFrame.insertionPoints.item(0).select();
app.paste();
catch(e){
myTextFrame.remove();
myPasteFailure = true;
else{
var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
myTextFrame.paragraphs.item(0).appliedParagraphStyle = myLabelStyle;
myFrameParentStory = myTextFrame.parentStory;
myStoriesArray.push(myFrameParentStory);
//=============================================================\\
function myGetParagraphStyleNames(){
var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
return myStyleNames;
function resizeOverset() {
for (var j = myStoriesArray.length - 1; j >= 0; j--) {
myLastFrame = myStoriesArray[j].texts[0].parentTextFrames[myStoriesArray[j].texts[0].parentTextFrames.l ength - 1];
myNewY2 = myLastFrame.geometricBounds[3]; //get the width of the text frame before doing fit()
myLastFrame.fit(FitOptions.FRAME_TO_CONTENT);
myNewY1 = myLastFrame.geometricBounds[1];
myNewX1 = myLastFrame.geometricBounds[2];
myNewX2 = myLastFrame.geometricBounds[0];

Similar Messages

  • How to delete all those images of an event "in one go" which were not used in a foto book of that event?

    How to delete all those images of an event "in one go"
    which were not used in a foto book of that event?

    To select multiple photos in an event for deletion hold down the Command key and click on those you want to delete.
    OT

  • [CS2][JS] Search text & replace with inline Image

    I am working with a large layout with many entries. There is a text "placeholder" that I need to search for and replace with an inline image in that exact spot.
    I need to apply an Object Style to that image.
    There is a loop above this for each find/replace to perfom
    I have supplied samples to show what the variables will hold
    The following assumes that an Objectstyle named "image" exists
    //places the image
    app.changePreferences = null;
    findName = "OR-00014500-24-0000-1";
    fileName = "Ads:OR-00014500-24-0000-1:OR-00014500-24-0000-1.eps"
    myFinds = app.search(findName)
    for (j = myFinds.length - 1; j >= 0; j--) {
    app.select(myFinds[j]);
    app.place(fileName, false,{appliedObjectStyle:"image"});
    This doesn't apply the style to the placed object and I have tried many different ways to apply this in the properties.
    Any help would be appreciated.

    I've seem to hit another hurdle....
    The code works well for searching and replacing the images. It applies the style to the image, but these images are not inline they are anchored. I ended up with a nice stack of images in the same corner.
    Ok... I need to then apply styles based on the images that have been placed already..
    This works well for cycling through the pages and with a bit more will change the style...
    myDoc = app.activeDocument;
    pagecount = myDoc.pages.length;
    for ( page=0; page < pagecount; page++){
    if (myDoc.pages.item(page).textFrames.length != 0){
    app.select(myDoc.pages.item(page).textFrames.item(0));
    piccount = app.selection[0].rectangles.length;
    if (piccount != 0){
    for ( bob=0; bob < piccount; bob++){
    app.select(myDoc.pages.item(page).textFrames.item(0));
    app.select(app.selection[0].rectangles.item(bob));
    // Get geometric bounds
    // alert(app.selection[0].geometricBounds);
    // Get object Style
    // alert(app.selection[0].appliedObjectStyle.name);
    // Do more here....
    I can't use this though :(
    I need to determine how many images have already been placed on the page before placing the image in the search and replace....
    myFinds = app.search(replaceName)
    for (j = myFinds.length - 1; j >= 0; j--) {
    app.select(myFinds[j]);
    myStory = myFinds[j].parent;
    myIndex = myFinds[j].index;
    //This will change using a series of Case Switches
    // Here is where I need to find the page and run the previous script or something like it myStyle = app.activeDocument.objectStyles.item("image");
    app.place(fileName, false);
    myStory.characters[myIndex].pageItems[0].applyObjectStyle(myStyle);
    app.select(myStory.characters[myIndex].pageItems[0]);
    //alert(app.selection[0].appliedObjectStyle.name);
    What I need to do is kind of combine the two....
    But I can't seem to get the current page of the selected image....
    I could use the page by page script, but it moves the character anchor point of images and pushes them to the next page. This throws off the pretty layout I'm going for.
    What am I doing wrong here ?

  • How to move ALL my images to a new SSD in laptop

    Howdy,
    I am adding a new SSD to my laptop (ran out of room) and want to move ALL my images (25,000) from my current Drive C to the new Drive D on my Alienware laptop.  How do I do "adjust" LR4 so that it sees the images on the D Drive versus the C Drive?  I can't find an answer and I do NOT want to make a mistake here to say the least
    Thanks,
    Mel

    This explains how to connect to your images on a different drive
    http://www.computer-darkroom.com/lr2_find_folder/find-folder.htm

  • How to download all the images of any website?

    I am developing an application in which a URL needs to specified for downloading all images of that website..
    Please help me out which java classes will be used for this purpose and how to proceed initially??.
    Thanks..

    rav_ahj wrote:
    I need to extract all the images from that website without clicking the links and saving every file manually...Is this possible using Urlconnection class??..Yes. URLConenction can download any URL you provide, or at least try to. How you get that URL, e.g. by searching for IMG tags, that's for you to solve.

  • How to relink all the image after moving the folders?

    I have a lot of illustrator files in folder A and each file has tons of images from different folders (B, C, D...). All of these folders are inside a main root folder.
    Recently I moved this root folder to an external drive then all the illustrator files disconnect with the images. Is there any way to relink all of those images all together instead of relink them one by one?
    Thanks!

    RGB2CMYK2 wrote:
    Thanks but then does it mean I not only have to relink everything but also have to gather all the images from different folders and put them in the same folder as the ai files? The images are from at least 20 different folders and there are more than a hundred of images in these 20 ai files.
    I would say you made a big mistake by moving all those image especially since you know you had 20 ai files each with hundred of images.
    Even if you did not move them this is a poor workflow sinvce for out put you more than likely would need to collect those linked images. That can be too much fun.

  • How to Download all the images for given product catalog into Localsystem?

    IN CRM - requirement is  to Identify products which are all having images for a given product catalog (maintained via Transaction Code : COMM_PCAT_ADM ) Download them into desktop.
    (around 20000 images).Please suggest me Function Modules if any.(or Standard transactions avaialable?)
    Thanks

    You can check if catalog Export functionality can be used to do your job. The feature allows to export the catalog with the mime objects (the images)...

  • How to see all my images in a large 3D world

    I have a 14 rectangles (shapes created in AE) distributed around a 3D world.  I have a camera (attached to a null) flying through the world to look at each one of the rectangles for a bit, and then move on.
    In order to get nice flowing camera moves, the rectangles are between 3000 to 5000 pixels apart, in pretty much a straight line, and at varying angles to each other.
    The problem I'm having is that I can't see all my rectangles at once.  AE won't zoom out enough to have them all on screen at the same time.  Once I zoom out to 1.5%, the hand tool stops working and I can't pan the view to the other objects, either at the head or tail.
    Even when I zoom in to 25%, those items that are outside the viewing area at 1.5% aren't viewable - the hand tool doesn't move the view beyond the 'edge of the universe'.
    I'm not a technical person, which is why I work on a Mac, so I don't know where to find all the system information that most people demand in these forums.  This is a work computer, so I don't know how it was built or the details of its configuration.  The information I DO know, is that I'm working on AE CC, the computer OS is Mavericks, and the computer itself is a tower with all the ram bays full.  If you need anything other than that to help me solve this problem, I'll need directions to get to the information you need.
    [insults removed by moderator]

    You can use the custom camera view and the camera tool to pull way back to see your scene. Personally, I would never put that many layers that far apart. I would put a wider angle lens on the camera or I would animate the scale of the layers as well as the camera move.
    Think of the AE stage as a real world stage and pixels as inches or feet. Setting up a camera move on a real set that had your characters a mile apart would be more than difficult and way out of scale. Even if it were inches, 5000 inches is about 400 feet. Rethinking the layout will make things a lot easier.

  • How to select (all black) image outline using script

    hi all,
    we have thousands of clipart images to convert from wmf to png. We need to apply some processing to each image. We do this by selecting the black outline with contiguous off so it selects all the black. We then inverse the selection and apply processing to the remaining color parts of the image, leaving the black untouched. We can easily automate all of the steps excluding the first black outline selection.
    anybody have any idea how we can do this?
    alternatively should we do this in illustrator when we do the conversion from wmf to png and create layers there?
    thanks.

    Thanks Michael, we're trying this now.
    Yes images are very similar in the fact that the have a complex hand drawn pure black outline with gradient colour inside.
    This gradient being a WMF is only linited to 16 steps, so the banding occurs. This is especially noticable when enlarged.
    so the purpose of the surface blur processing is to smooth this banding in the output png image, but keep the black outline sharp and crisp.
    Below is a sample of one of the images done manually. now only 5999 to go
    original wmf: https://dl.dropbox.com/u/40046102/Aardvark%20v2.wmf
    Imported PNG from WMF through Illustrator, note the colour banding in the blue fill:
    when smoothed in photoshop:

  • How to Retrieve all Azure Images located to "East Asia"

    I'm using Azure Powershell to retrieve all Windows Azure VM Images, can I filter it to show only available images located in "East Asia"?

    Hi,
    Please have a look at below article.
    #http://michaelcollier.wordpress.com/2013/07/30/the-case-of-the-latest-windows-azure-vm-image/
    Here is a snippet.
     modify the script to include logic to select images that are only available in the desired data center location.
    $images = Get-AzureVMImage `
    | where { $_.ImageFamily -eq "Windows Server 2012 Datacenter" } `
        | where { $_.Location.Split(";") -contains "West US"} `
        | Sort-Object -Descending -Property PublishedDate
    Using the above snippet, only the most recent version of the “Windows Server 2012 Datacenter” image that is supported in the “West US” datacenter will be returned.
    Hope this helps.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
     Click  HERE to participate the survey.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to recover all the images that i´ve lost because the new system for i phone erased all of them?? please help

    i´m very upset. got the latest software for the iphone 4, and inmediatlly got trouble with recovering the system back
    my computer crushed tons of times. lost all my pictures! i had an icloud back up, but it´ve changed as well !
    what to do?
    thanks

    If the computer's running Mac OS X, move the cursor to the very top of the computer's screen, click on Store, and choose Authorize this Computer.
    If the computer's running Windows, press the Alt and S keys and choose Authorize this Computer, or click here, follow the instructions, click on Store in the menu bar, and choose Authorize this Computer.
    (112271)

  • How to save inline images and attachments separatley?

    Hi,
    I want to save all inline images into a certain directory and all attachments into another directory.
    I use the following code to do this:
      Multipart multipart = (Multipart) message.getContent();
            for (int x = 0; x < multipart.getCount(); x++) {
                BodyPart bodyPart = multipart.getBodyPart(x);
                String disposition = bodyPart.getDisposition();
                if(disposition != null){
                     log.debug("Disposition: " + disposition);
                     if (disposition.equals(BodyPart.ATTACHMENT)) {
                          log.debug("Mail has attachment: ");
                         DataHandler handler = bodyPart.getDataHandler();
                         log.debug("FILENAME: " + handler.getName());                    
                         saveAttachment(session, bodyPart, emailData);
                     else if(disposition.equals(BodyPart.INLINE)){
                          log.debug("Mail has inline attachment: ");
                         DataHandler handler = bodyPart.getDataHandler();
                         log.debug("Inline FILENAME: " + handler.getName());
                         saveInlineAttachment(session, bodyPart, emailData);
                else {
                     log.debug(bodyPart.getContent());
            }This approach works when the email has inline images only or attachments only.
    It does not work when the email has both inline images and attachments. (Only the attachments are saved).
    Come someone please help me correct my solution so that it can process an email that has both inline images and attachments and save them in different directories.
    Thank you

    Thanks bshannon.
    It took me a while to understand what you meant but I think I finally got it.
    I modified the getText method in order to save the embedded images:
    private Image getImages(Part p, EmailData emailData, String ext) throws MessagingException, IOException {
             if (p.isMimeType("image/*")) {
                InputStream is = p.getInputStream();         
                BufferedImage im = ImageIO.read(is);
                String fileName = "attachments/inline/body " + inlineImageNumber++ + "." + ext;
                File imageFile = new File(fileName);
                ImageIO.write(im,ext,imageFile);
                is.close();
                emailData.getInlineAttachments().add(fileName);
                return null;
            if (p.isMimeType("multipart/related")) {
                Multipart mp = (Multipart)p.getContent();
                Image image = null;
                for (int i = 0; i < mp.getCount(); i++) {
                    Part bp = mp.getBodyPart(i);
                    if (bp.isMimeType("image/jpeg")) {
                        if (image == null){
                            image = getImages(bp, emailData, "jpg");
                        continue;
                    else if (bp.isMimeType("image/gif")) {
                        if (image == null){
                            image = getImages(bp, emailData, "gif");
                        continue;
                    else if (bp.isMimeType("image/bmp")) {
                        if (image == null){
                            image = getImages(bp, emailData, "bmp");
                        continue;
                    else if (bp.isMimeType("image/png")) {
                        if (image == null){
                            image = getImages(bp, emailData, "png");
                        continue;
                return image;
            else if (p.isMimeType("multipart/*")) {
                Multipart mp = (Multipart)p.getContent();
                for (int i = 0; i < mp.getCount(); i++) {
                    Image image = getImages(mp.getBodyPart(i), emailData, "");
                    if (image != null){
                        return image;
            return null;
        }

  • How to mass-delete unrated images in Lightroom?

    Hi everyone and happy Memorial Day.
    I wonder if someone can help me with a Lightroom question.
    How can I erase all of my un-flagged images? I would like to quickly flag or otherwise mark all the keepers and maybe keepers and then delete all the rest. I feel like there must be a way because having to hit each image with an "x" to reject it seems like too big a pain for there not to be a shortcut.
    I recall someone on a forum told me how to delete all rejected images at once by hitting CTRL-BACKSPACE and that has saved me hours of wasted time over the last couple of years. I hope someone can suggest a similar shortcut for deleting all unrated images, keeping my flagged ones safe.
    Scott
    Canon 6D, Canon T3i, EF 70-200mm L f/2.8 IS mk2; EF 24-105 f/4 L; EF-S 17-55mm f/2.8 IS; EF 85mm f/1.8; Sigma 35mm f/1.4 "Art"; EF 1.4x extender mk. 3; 3x Phottix Mitros+ speedlites
    Why do so many people say "fer-tographer"? Do they take "fertographs"?

    "A related note: who worries the next Adobe Lightroom will go to the "Creative Cloud" ."
    I have been dealing with Adobe for 40+ years and one thing for sure, you never know.  I am a beta tester for them. They don't tell us much either.  I am going to "guess", likely.  Maybe 60/40 to go cloud.  Make sure you keep your copy up-to-date!
    Photoshop and Lightroom plus the rest of CS are mature products.  Meaning the market is saturated.  The only new revenue is the few new photographers that enter the field.  This leaves Adobe to just do upgrades to make a profit.  Is the upgrade worth it?  Every 18 months or 2 years?   To some, yes but to others no.  Makes future predictions of revenue difficult.  The CC format guarantees a constant revenue stream, forever.  Adobe's profits are very high right now and their stock is up.  So your guess is a s good as mine.
    You are also likely to see other mature software go the subscription route.  Microsoft Office 
    There is also the misguided theory that bootleging would be better controlled but that hasn't happened.
    EOS 1Ds Mk III, EOS 1D Mk IV EF 50mm f1.2 L, EF 24-70mm f2.8 L,
    EF 70-200mm f2.8 L IS II, Sigma 120-300mm f2.8 EX APO
    Photoshop CS6, ACR 8.7, Lightroom 5.7

  • How to scale animation? (or apply scale transforms?)

    Hi,
    I made a flash game in 640x480 pixels resolution with lots of skeletal animation and bitmap-graphics. Now I want to recreate the very same game for 1024x768. Graphicwise this is no problem, since I've drawn the graphics in a much higher resolution anyway. But I have problems figuring out how to scale all the animations (tweens) I did in the Flash IDE. Needless to say I can scale each MovieClip to 160%, so they have the right size. But then the MovieClips graphical pieces look pixelated, so I would like to replace those pieces with their higher resoluted equivalents. However, if I do so the higher-resoluted-equivalents are, of course, in turn scaled to 160% as well, so they end up far too big. What I am looking for at this point is a way to apply the scale to the MovieClip as well as its contents. Is there a way to do this? And if not, how would you go at scaling animations / tweens to higher resolutions inside the Flash IDE?
    Or do I have to recreate all animations? (That would be a lot)
    By the way, the animations are to be read by the DragonBones-plugin directly inside the Flash IDE (it creates a texture-atlas and xml-files out of the movieclips), so affecting things with Actionscript is no option.
    Best regards

    I also would recommend using a tool like the above mentioned. The process will otherwise require exactly what you don't want to do, replace each piece individually with adjustments.
    There is some JSFL code that can help here but honestly learning a new language just to solve this one short case issue isn't really advisable.
    It might be a good time to consider Stage3D however. While this is an even larger leap than re-importing and aligning all assets, the performance boost would be so amazing it would be well worth your time. 2D sponsored engines like Starling have a texture scale during import that can help here as it seems based on your desired resolution that mobile is or may be important.

  • Scale batch of images - can I do it ?

    Hello gentlemen,
    I have about 40 images that I've imported into the timeline in PP.
    Is there a way to scale all the images down at one time ?
    I'd like to scale all of them down about 60% or so.
    Thanks for a any info, and your time,
    Dave.

    Hi Harm,
    Ok I did what you suggested, and it works ( somewhat ), something is strange though.
    I scaled the nested sequence down to 60% but instead of the images actually scaling "un-zooming" so I can see them, the whole series of images is scaling, but as in just getting smaller within the rendering window area. So I don't actually see the whole image like I wish to see, - scaling the sequence just makes the series of images smaller on the screen . ( example - in one image, I see the person's arm, where the full image shows the whole person ).
    If I go and scale the image alone, the image becomes "unzoomed" and I can see the whole person, but in the sequence, the whole "zoomed" image just becomes smaller in the rendering window area.
    Dave.
    Off to try CWrig's suggesion now,, but why is your suggestion not working for me ?

Maybe you are looking for