Replace images on specific layer

Hi,
till now i used the Script-function in InDesign only for "findandchange"-Actions. It works fine and is very time-saving.
Now I would like to replace images on specific Layers, like I do this with textcontent with the "Findandchange"-Script.
Is this possible?
I try to explain...
Example:
- Find all images "image-a1.tif"(path:folder/folder/image-a1.tif) on specific layer "mylayer"(or only activ and not locked layers)
- Replace all this images with this image "image-a2"tif(path:folder/folder/image-a2.tif)
- Find all images "image-b1.tif"(path:folder/folder/image-b1.tif) on specific layer "mylayer"(or only activ and not locked layers)
- Replace all this images with this image "image-b2"tif(path:folder/folder/image-b2.tif)
- Find all images "image-c1.tif"(path:folder/folder/image-c1.tif) on specific layer "mylayer"(or only activ and not locked layers)
- Replace all this images with this image "image-c2"tif(path:folder/folder/image-c2.tif)
Background Info:
These images have all the same size and resolution. They distinguish only in content (english-/france/german elements).
It's a "multilanguage" InDesign-Document. Every "Languagecontent" have its own layer.
Thanks for helping...

Hi,
Yes you can. I.e using dialog box.
It could be like this:
myDoc = app.activeDocument;
myGraph = myDoc.layers.item("graphic").allGraphics;     // modify layer name
for (k=0; k<myGraph.length; k++)
     oldLink = myGraph[k].itemLink.filePath;     //whole path
     oldFileName = File(oldLink).name;              //only file name
    newFileName = myDialog(oldFileName);     // new name is read from dialog
     if ( !newFileName ) continue;                         // if user press "cancel" button - no action
     newLink = File(oldLink.replace(oldFileName,newFileName) );    // replace file names within path
     if (File(newLink) instanceof File)                     // if wrong newLink - no action
        myGraph[k].itemLink.relink(newLink);     //relink graphic
function myDialog(oldName)
    var myWindow = new Window ("dialog", "Replacing images");
    var myInputGroup = myWindow.add ("group");
    myInputGroup.orientation = "column";
    myInputGroup.alignChildren = "left";
    myInputGroup.add ("statictext", undefined, "Old Name: " + oldName);
    myInputGroup.add ("statictext", undefined, "New Name:");
    var myText = myInputGroup.add ("edittext", undefined, ".eps");
    myText.characters = 20;
    myText.active = true;
    var myButtonGroup = myWindow.add ("group");
    myButtonGroup.alignment = "right";
    myButtonGroup.add ("button", undefined, "OK");
    myButtonGroup.add ("button", undefined, "Cancel");
    var OKbutton = myWindow.show ();
        if (OKbutton == 1) myRes = myText.text;
        else myRes = false;
    return myRes;

Similar Messages

  • Replacing or swapping a layer

    Is there a way like in After Effects to replace or swap a layer in a template for daily News Premix. I know how to do it with new layers, copy my alpha ... etc. Just wondering if there was an easy way ?
    Does this make sense ?
    thanks
    JR

    If I understand what you're trying to do, the best way may be to use File > Place to import the template's original layer content as a Smart Object, so that next time you can use the Layer > Smart Object > Replace Contents command to swap in a different image file from disk into the layer.
    >This is the Photoshop Forum. I suggest you ask over at the After Effects Forum.
    JR2010 said "like in After Effects," not "in After Effects." In fact, it's because he said "like in After Effects" that the Smart Object idea came to mind, since the way layers work in After Effects is more like Smart Objects in Photoshop than a regular Photoshop layer would be.

  • Switch image in a layer but keep the layer mask

    Hi, I`m trying to swich a image on a layer whit a layer mask. I whant to keep the layer mask but change the image. When I paste a copyed image it the laye it creates a hole new layer. How can I change a image but keep the layer mask? 
    Tanks Lasse

    You have things backwards: You copy&paste the layer mask and/or duplicate a selection by loading it using Ctrl+click on the thumbnail, then creating a new mask from it. After that you can delete the original layer. Also more recent versions allow drag&drop replacement of this stuff, but you have to be careful which thumbnail you drag...
    Mylenium

  • Why can't we replace images in photo stream?

    Shared photo streams could be great, but it has a big downside because we cannot replace images in it. How many times haven't I uploaded images that I later wanted to edit? But the only way to replace an image is to delete it and upload a new one. It will appear at the end of the stream as a new project, and all comments will disappear.
    Please give us a better way to replace images, that makes it possible to keep the original place in the photo stream, and keep the comments.

    Hi there Harvest 61,
    You may find the troubleshooting steps in the article below helpful.
    iCloud: My Photo Stream troubleshooting
    http://support.apple.com/kb/ts3989
    -Griff W. 

  • Replace Images in Keynote '09

    I need to update a presentation with new updated images. Is there a way to swap the current image with another, keeping its animation and properties without going through the pains of inserting the new image, formating it and reapplying the animation. (I can do this in Powerpoint)

    Another way I use all the time is to open the package and replace images. As long as the new image has the same name as the original, when you open the document it will load the new image with the same settings as the original. Note that the new version of keynote does not save projects as packages unless you tell it to in the settings... and then it only does that to new documents.

  • Image in a layer mask with gradient problem

    Hi,
    I have a image in a layer mask with an gradient on a 30c0m0y100k background and at the gradient from image to background I always get a white "shine". which NOT appears when the background is the standard photoshop-black definition in all colors.
    please have look also here (where the problem is): http://adobe.ly/1yXBCix
    and here where it looks like I want to have it (where I switched the layer mode of the mask to multiply and that causes that my background is not anymore 30c0m0y100k): http://adobe.ly/1HFZfC4
    thanks a lot!
    oliver

    Yes, just save it and post it here using the little camera icon:

  • Script for replacing Image from a frame into InDesign document file

    Hi All,
    I am having an indesign document (indd) file with images and texts. I am using InDesign Server CS4 to run the scripts via SOAP.
    My requirement is to replace any of the images from the required frame/s of indesign document through scripting (I already have frame id of which image needs to be replaced). I have written written java-script file (as given below): but when I execute this java-script on InDesign Server via SOAP, I get follwoing error into InDesign Server:
    10/03/09 15:15:54 INFO  [javascript] Executing File: \\Server_IP_Address\JavaScript_File_Path\JavaScript_File.js
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/help.gif
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/Documents%20and%20Settings/All%20Users/Documents/My%20Pictures/Sample%20Pictures/ Water%20lilies.jpg
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/Documents%20and%20Settings/All%20Users/Documents/My%20Pictures/Sample%20Pictures/ Winter.jpg
    Following is the java-script that is being used for replacing image from indd's frame:
    var myDocument = app.open(File('//Server_IP_Address/InDesignDocument_File_Path/Sample.indd'));
    var tmp_frmid="1339"; //frame id of which image needs to be replaced.
    for (var i=0;i<myDocument.pages.length;i++)
    var objPage=myDocument.pages.item(i);
    var objPageitems = objPage.pageItems;
    try
    var obj = objPageitems.itemByID(tmp_frmid);
    obj.images[0].remove;
    obj.appliedObjectStyle = null;
    var myImage=obj.place(File('//Server_IP_Address/Images_to_be_reolaced_Path/ImageFile.jpg'));
    var old_height = myImage.geometricBounds[2] - myImage.geometricBounds[0];
    var new_height = obj.geometricBounds[2] - obj.geometricBounds[0];
    var old_width = myImage.geometricBounds[3] - myImage.geometricBounds[1];
    var new_width = obj.geometricBounds[1] + ((new_height / old_height) * old_width);
    myImage.geometricBounds = [obj.geometricBounds[0] + "mm", obj.geometricBounds[1] + "mm", obj.geometricBounds[2] + "mm", new_width + "mm"];
    var diff = obj.geometricBounds[1] - myImage.geometricBounds[1];
    myImage.move( undefined, [diff,0] );
    break;
    catch(e)
    myDocument.save('//Server_IP_Address/InDesignDocument_File_Path/Sample.indd');
    var previewFile = File('//Server_IP_Address/Images_to_be_reolaced_Path/ImageFile.jpg');
    app.jpegExportPreferences.jpegQuality["JPEGOptionsQuality.low"];
    app.documents.item(0).exportFile(ExportFormat.jpg, previewFile);
    myDocument.close();
    I have very urgent requirement; if anyone have any idea; please suggest me. \
    It would be highly appreciable.
    Kind Regards,
    Prashant.

    http://www.automatication.com/selection-to-pdf-script.html
    Harbs
    http://www.in-tools.com

  • How do I save a specific layer as an audio file

    I needed a second audio file and created a layer and placed my video file that has the audio I want in that layer.  I edited the audio in that layer and now I want to save the result as an audio file.. preferably an MP3 file. How do I select a specific layer and save just that layer as an audio file?

    I would think  with Photoshop you may be able to save it as a video mp4 file then find a Video splitter program to split out the audio.  Or use and Audio program in the first place rather the using a program like photoshop that can do some basic video editing.

  • Is it possible to paste two images into one layer?

    I'm having some issues pasting two images into one layer. Every time I paste the second image, it automatically creates a new layer...is there anyway to prevent that from happening? I'm making an animation on photoshop and I want there to be more than image in some of the frames. Please let me know if you have any suggestions! Thanks!

    You can merge the two layers together once they're position. Select the top layer and choose merge down or select both and choose merge layers (from the layers menu).
    http://help.adobe.com/en_US/Photoshop/11.0/WSfd1234e1c4b69f30ea53e41001031ab64-78b2a.html

  • Photoshop Elements 13 how to open an image as a layer?

    Hello, I recently received as asked Photoshop Elements 13 for Christmas, and have been using Gimp for about a year now as a substitute. However, when I went to start a project, I couldnt figure out how to open an image as a layer. Any help would be appreciated, thanks!

    Heres an example with 2 images. I want to get the image you see in this picture, and place it in the original image as a layer, not a separate project.

  • How to replace images in slideshow?

    I would like to replace images in slideshow, but I can see only ADD option.

    Thanks Parikshit.
    Looks the trick would be to turn on Thumbnails, delete the image and turn it off.

  • Aperture replaces images with other images that have the same image number

    Help! Aperture has started replacing images in recent projects with older images from elsewhere on my hard drive that have the same image number. Obviously I need a better numbering system, but can someone help me figure out why this is happening? I store master files on an external drive and the "replacement" files seem to be coming from identically named images on my local HD or in iPhoto.

    I started renaming all of my images when I import them. I'm using referenced images to an external drive, although I still have a bunch of older images stored in the Aperture library under my old numbering system (which was basically whatever image number the camera generated)....need to move them all to the external drive but haven't had time.
    So here's the latest problem: Today, Aperture started replacing images in albums (referenced images with unique file names under my new system) with old images even though the file names weren't even remotely close. It also replaced the images with the preview for the old image (230 pixels wide). "Show master" showed me the preview for the old image, not the correct image.
    I tried forcing an update to the preview, but it had no effect. The real masters are intact on the external drive, but this is really scaring me. It happens out of the blue, right in front of me...I watch as my images appear to be replaced with random old images in Aperture. It appears to have nothing to do with file names, as I'm now using totally unique file names.

  • Process for replacing images

    I would like to get our opinion on how I am working when replacing images.
    The help-project has not been updated since it first was generated but much has been done to the system. So there are a lot of images to replace but I have very limited time and the customer want as much as possible to be done. This means that I have to do some things in a way that might not be the best way but is the fastest. But I don’t want to work in a way that we later regret because it causes some problem that I haven’t realized yet. I don’t have much knowledge of the updates of the system or of the RoboHelp-project (what is described in the help, where in the help is it described).
    I capture the image with IrfanWiew.
    I delete the old image in the Design Editor. (I’m aware that the image is not removed from the project but I will deal with this later.)
    I paste the image in the Design Editor. (I find this the fastest way to get the new pictures where they should go.)
    When I have finished replacing images I create a folder and drag the images there (either in RoboHelp or in Windows Explorer).  The old images are in a separate folder but I don’t want the new images in the same folder because it might be some name conflicts.
    I remove unused images by looking at the report Unused Files.
    Is this an ok way to work?

    If you are replacing one image with another, you could could save them with the same file name and in the same location. Your project should then pick it up. However there is a proviso that the old and new images are exactly the same size. If they are not, you may have to reset the image size inside the Design Editor for each image.
    If you use your workflow, I would not paste the image in. Whilst this is acceptable, you'll end up with image file names that bear no resemblance to the image (e.g. image001.png, image002.png, etc.) which may create future difficulties. Also ensure you drag your images from INSIDE your project. If you do this in Windows, your project will be unaware you have moved them and report them as broken links.

  • Pen tool: Resize image inside a layer/ stop pen outline / white space after crop

    I have 3 noob questions all related to the pen tool.
    1. Whenever I use the pen to outline something and drag the image to another psd file I see a grey pen outline around the image.
    ex. http://screencast.com/t/GmKWAr5UH
    2. Whenever I outline with the pen and then select inverse and then delete the background, the background becomes white. I want to drag my outline into my new file but without a white background. it should be transparent so it appears like a collage.
    ex. http://screencast.com/t/Rh4Uvq4xBM
    3. how do I select an image inside a layer to resize it. Nothing I do creates handles around the image isnide the layer.

    Theres some basic stuff you are not understanding…
    1. In Photoshop there is the pen tool for creating abstract vector edges, and selection tools (lasso, magic wand etc). You need to turn the results of the pen tool into a selection. Best way is using the the Command/return shortcut, or command clicking on the path in the paths panel.
    2 layers need to be , not - If you want to delete areas (make them transparent). To do this either go to Layer/New/Layer from background - or hold Option and double click the Background layer.
    3 See answer 2, and use Free Transform (command T)

  • Please help. Javascript to open/place a file onto an open document to a specific layer

    Hello,
    I would like a javascript that would open and place a PDF file to an active document in Illustrator. I would like it to place it to a specific layer, align it to the art board, and then embed it. Can someone please help?
    Thanks in advance.

    This should be close to what you want:
    var sampleFile = new File( Folder.desktop.fullName + "/SampleFile.psd");
    if (sampleFile.exists) { app.open(sampleFile); }
    else { alert("Could not locate sample file on the desktop."); }
    Tested it out on a Windows machine with no problems.

Maybe you are looking for