AppleScript to delete the page and the selected layer

Hello

This is part of a larger script, but this is where I'm having the problem. If all goes well, very easy to solve, but makes me crazy.

I want to delete a text box on the current page only, and only a single layer.

I can operate on a single layer, but all pages. And on a single page, but all the layers.

Could someone please help me to write the line to select the active page and layer "slug".

Thank you

Matt

say application "Adobe InDesign CS5.

Activate

set myDocument for the active document

set myActivePage to the page active of the window active

the value myLayer to layer "Slug" of myDocument

myLayer say

say myActivePage

       Ungroup groups

delete ( each block of text that contains "" remove me ")

end say

end say

end say

You want something like:

delete (each block of text that contains "" remove me "and point layer is myLayer)

Tags: InDesign

Similar Questions

  • delete the selection: fill dialog opens automatically

    For some reason when I make a selection and press the 'delete' button, the fill dialog box opens. This habit never to arrive and he would just automatically fill the layer with the selected background color. I can't find an option to turn this off.

    normfb wrote:

    The filling appears because you're on a locked layer.

    Trash the lock and you can delete the selection

    I didn't have layers Locked Norman.  I was going to say that the OP was probably an attempt to change the background layer.

  • What to do if I deleted the menu layer on the left and want to get it back?

    Hi guys. I use photoshop and I deleted the menu layer on the right with the colors and all the layers. How can I get that menu back?

    Press F7 or go to the main menu and select Windows > layers.

  • Help, please! I can't select the shape I drew with the pentool again... I have the selected layer, but there is no sign of my new shape in my path Panel?  I have been sitting here for days literally and simply cannot make it appear the race that I created

    HI - can help I'm going crazy! !

    I drew a shape with the tool pen (which took me Age..) and I go back an image that I imported, I cannot select once again it.  I can see it in red, but I'm not able to select once again it.  I have the selected layer, but there is no sign of it in my Panel of traces at all.  I tried clicking on the direct Selection tool (about 100 times), I tried the Brush tool.  I've tried everything.  The same thing happened to me the other day...    Please can someone help!  Tania

    It's the plug technique on the subject:

    Using Photoshop | Manage paths

    It contains this point under manage paths:

    When using a shape or pen tool to create a work path, the new path appears as the work path in the tracks Panel. The work path is temporary; You must save it to avoid losing its contents.

    OK, the red, you mentioned is a Stoke you added. Then quick mask is not involved.

  • How to remove each layer except the selected layer?

    Hello

    I would like to delete all layers including the background sets and layer except for the selected layer.

    It seems easy to first, but it stops... I tried in several ways; What I am doing wrong?

    #target photoshop
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
    
    app.bringToFront();
    var doc = app.activeDocument;
    var currentLayer = doc.activeLayer; // remember the selected layer
    var selectedlayername = currentLayer.name;
    currentLayer.move( activeDocument, ElementPlacement.PLACEATBEGINNING );  
    
      function DeleteLayer(layername) {  var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();   ref1.putName(cTID('Lyr '), layername);
        desc1.putReference(cTID('null'), ref1);     var list1 = new ActionList();
        list1.putInteger(17);  desc1.putList(cTID('LyrI'), list1);  executeAction(cTID('Dlt '), desc1, DialogModes.NO);
      };
    
    function DeleteBackground() { var desc1 = new ActionDescriptor();  var ref1 = new ActionReference();   ref1.putProperty(cTID('Lyr '), cTID('Bckg')); desc1.putReference(cTID('null'), ref1);     var list1 = new ActionList();     list1.putInteger(1);   desc1.putList(cTID('LyrI'), list1);    executeAction(cTID('Dlt '), desc1, DialogModes.NO); };
    
    function initial () {
    for(var i = 0 ; i < doc.layers.length;i++){    if (doc.layers[i].isBackgroundLayer == true ) {  DeleteBackground();} }
    var layerNum = doc.layers.length;
    for(var  s = 1 ; s <= layerNum;s++){
       if ( doc.layers[s].name != selectedlayername ) {   
           DeleteLayer (doc.layers[s].name);
           }
       else if ( doc.layers[s].name == selectedlayername ) {
           }
       }
    }
    
    initial();
    

    Thank you

    Best regards.

    Hi arteangelus,

    Try this Code...

    #target photoshop
    var docRef = app.activeDocument;
    var layName = docRef.activeLayer.name
    var l = Number(docRef.layers.length)+1;
    while(--l){
        if(docRef.layers[l-1].name!=layName && docRef.layers[l-1].name!="Background"){
            docRef.layers[l-1].remove();
        }
    else{continue;}
    }
    

    -yajiv

  • keyboard shortcut. (period) disable the classification in the selected layer

    I can't get my keyboard shortcut to disable the selected layer of ranking to work. Windows has the same Mac keyboard shortcut and I'm Windows.

    I use full screen and want to turn off a layer classification but cannot. I have to go back to the main panels and turn off the eyeball for the selected layer.

    Is it me who can not get this keyboard shortcut from. (period) to work?

    If I go on my pad and think that the. (period) is there, I find myself remove the selected layer using what, in my view, could be the. (period) there.

    This keyboard shortcut was reassigned and I use a pdf of Speedgrade obsolete reference? But this one is 10/12/2014.

    Everything could find your question! Re-entered Sg, played with touches of 'standard' period and paved num. Then tried to turn the NumLock... then, rather than being a temp power gimbal, the period key just to delete the layer selected. Not like a rocker... just delete the layer. Had to go back to history (Ctrl/Com - H) back on my bed.

    Then... you can check the status of your caps lock...

    Neil

  • Problem with 'Create new Extrusion of the selected layer' CC 2014

    Hello, I am experienced with Photoshop but I'm new to 3D text in Photoshop.  I type the text and convert it to a form.  When I choose to create new Extrusion of the selected layer I get the dialog, I don't see in tutorials.  It says "you are about to create a 3D layer.  You want to switch to the 3D workspace?  Yes/No, do not display again. "Which one should I use for the 3D text?

    If I choose Yes, all the panels disappear and the content in the tool options bar (Ribbon?) just under the menu bar disappears.  I have to restart Photoshop to get back on the tool options.  What could I do it wrong?

    Thanks - Dave

    I just chose 'No' and don't look at back.  I love my workspace, just as it is and doesn't prefer Photoshop to change for me in this case especially.

    You bring up the 3D Panel yourself via the window - 3D.  I think it's a good alternative for the Actions Panel, because I don't have any currently working in the 3D world.

    You'll want to see easily if you are working on 3D are 3D Panel and panel properties, among a few others.

    Regarding return your workspace as you like it...  Note the small switch near the upper right of the main window of Photoshop.  That can be used to select a workspace.  I suggest that you experiment and familiarize yourself with the concept of workspaces.  You can set your own and save it with a name, and that can really be useful.

    -Christmas

  • How can I delete a page and rearrange the other pages?

    I'm trying to delete a page/document and then rearrange the remaining pages/documents. I followed the instructions to help Adobe, but my toolbar does not give me the option to delete or move documents as indicated in the instructions on the help page. The thumbnail gives me only the possibility to increase/decrease the size or print. Please advise I'm losing my mind and have need to understand that as soon as possible because it is for a Web site online. I downloaded the latest update. Thank you!! L

    The instructions that you read were for Acrobat from Adobe, and no Adobe Reader. Reader doesn't have this capability.

  • I have the move tool and the selected layer...

    but for some reason, I can't text to line up anywhere. The alignment buttons act as if they are grayed out. Is there something that I am missing?

    There are at least two selected layers (the text layer and the background layer) or the text layer and a selection (i.e. Select all...) for alignment controls and buttons to activate and go down the text of the document.

  • The selection layer handles are not visible

    When you create a layer in DW 8 via the Insert > objects Layer > layer or by clicking on the layer to draw on the tab page layout in the menu Insert, the default layer to the width of the window of my design. When I click on a layer I can't access the selection handles.

    Issues related to the:
    1. How can I size a layer to my taste instead of always taking the width of my screen?
    2. What can I do if I see eight selection handles when I click on a layer?

    Thanks for the research.

    Bingo. I thank you for your time and expertise.

  • Script to change the selected layer to one of the drop-down list in the layers palette colors

    Hello!

    I was wondering if anyone knows of a script that would allow me to change the selected layers (single or multiple selection) in 'Light Blue' or all the colors in the menu drop-down? (see attached screenshot)

    I found the following but it changes all layers and is the RGB color.

    -----

    say application "Adobe Illustrator"

    set current_Layer in current document

    view the dialog box "in the current document there is" & layersCounter & "layers." & "Recolor label layers?"

    Repeat until (layersCounter = 0)

    set color of layer layersCounter in the current document to {Light Blue}

    set layersCounter to layersCounter - 1

    end Repeat

    end say

    -----

    Screen Shot 2015-06-12 at 10.46.46 AM.png

    I don't know how the script so any help is greatly appreciated. Thank you in advance!

    John

    as far as I can tell this is only possible with a few other modifications... Since 'selected' is not a property of "layers" javascript cannot determine if you see a highlighted layer in the layers panel.

    you could do one of 2 ways. Depending on how many layers you want to change the color, you can either make those visible or hidden (for example, if you want to change to 80% of the layers of a specific color, hide others 20%). and then simply add a clause inside the loop if for.

    var doc = app.activeDocument;

    var layers = doc.layers;

    Blue of var = new RGBColor();

    Blue.Red = 79;

    Blue.Green = 128;

    Blue.Blue = 255;

    for (i = 0; i<>

    If (layers [i] .visible == true) {}

    var = aLay layers [i];

    aLay.color = blue;

    }

    }

  • Action written in CS4 does not work properly in items 11 - contexts the 'selective' layer

    I created an action with the help of Adobe Photoshop CS4, and that it works in CS4.  When I save and load the action in 11 elements, there is a problem with the selective color layer.  The selective color layer is revealed in the stack of layers with the message whereas it cannot be edited b/c it was created in the full version of Photoshop. However, the layer itself has no changes in color/inside.

    In Photoshop, the selective color layer makes the photo look pink.  When I run the action in Elements11, selective color layer doing absolutely nothing to the photo.  I don't have the turned eye "on" to display the layer, and it is on the correct merge options & opacity (normal, 100%).

    If I run the action in Photoshop, save the file with all the layers created by the action and reopen the file in 11 elements, THEN the selective color layer shows its correct pink color.  But when I run the action as an autonomous action in Elements11, is not.

    Can anyone offer help as to why this is happening? Is there something special I need to do to make the action work in 11 elements? My understanding is that he must RUN and create the layers correctly, although some of them cannot be changed in Elements11. However, as it is, is not creating them with the appropriate color.

    Thank you in advance for your help!

    selective color layer is not supported in PSE11. So any stage to edit would result in the error message saying that the layer can not be displayed.

    For your case, I believe that the recorded action starts by creating a selective correction blank adjustment layer and then tries to change and thus translates into a mistake.

    Even the effort to apply the effect by using result of adjustments of image by mistake as the "selective" command is not available.

    I would try to find another way to apply the effect, but I don't know if there is a way to apply an adjustment layer that is not supported by PES

  • Moves other than the selected layer layers

    After you select a layer by dragging in the image box and move other layers above this layer or folder of the group. The first selected layer is more selected, the affected layer is even if I was just dragging inside the picture of my initial layer box. CS4 Windows

    Two things to check for

    (1) see if the layer is locked.

    (2) If you were moving to the origin of this layer and the latter it does not move, look in the toolbar above and if the automatic selection box is checked.

    When this box is checked, you can select a layer on the image it self. This can be difficult if there is not a lot of clearance between the two layers as a small image on one of the layers. It would be possible to accidentally select the wrong layer when you try to drag. With the box unchecked, then you have to select the layer in the layer panel.

  • Move the selected layer shortcut object

    Hello world

    I would like to be able to invoke a script that would simply move the object selected (block of text or image) to another layer without having to open the layers panel, select the point and drag to another layer I. I find it tedious and awkward especially on repetition.

    I previously asked the people here how I could run a script that searched objects with an assigned attribute and retrospectively to move them all to a single layer. But I prefer to be able to hit a command with the selected object, which pushed the object on a specific layer.

    For me, this really should be a built-in shortcut, such as control-alt-down top /. As far as I can tell this is not assigned to anything else and would be really helpful!

    Can someone suggest a solution to do this, script or other?

    Thank you very much!

    Lewis

    How about this dynamic Duo?

    //DESCRIPTION: One Layer Down
    for (s=0; s
    
    //DESCRIPTION: One Layer Up
    for (s=0; s 0)
      app.selection[s].itemLayer = app.activeDocument.layers.previousItem(app.selection[s].itemLayer);
    }
    

    It works, even with a multiple selection on different layers.

    Be warned that, without the Panel layer open, you don't maybe not up-to-date on your active layer current! It changes because a selection is moved from one layer to another.

  • Get the position of the selected layer and anchor

    Hello

    I'm choosing a bitmap layer on the timeline and the execution of this script:

    model var = app.project.activeItem;

    Alert(COMP.selectedLayers[0].position[0]);

    It returns the value undefined.

    If I run:

    model var = app.project.activeItem;

    Alert(COMP.selectedLayers[0].position);

    It returns [object property]

    I would also like to be able to get the anchor in the same way. Can't get that to work either.

    Alert(COMP.selectedLayers[0].) AnchorPoint [0]);

    What I am doing wrong?

    Thank you

    Jakob

    Try this way:

    model var = app.project.activeItem;

    Alert(COMP.selectedLayers[0].position.) Value [0]);

    Dan

Maybe you are looking for