• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Move selected object to layer shortcut

Community Beginner ,
Aug 04, 2009 Aug 04, 2009

Copy link to clipboard

Copied

Hi everyone,

I'd like to be able to invoke a script that would simply shift the selected object (text frame or picture frame) to another layer without me having to open the layers panel, select the tiny dot and drag to another layer. I find this fiddly and awkward especially on repetition.

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

To me, this really should be an inbuilt shortcut, such as command-alt-up/down arrow. As far as I can tell this isn't assigned to anything and would come in really handy!

Can anyone suggest a solution for this, script or otherwise?

Many thanks!

Lewis

TOPICS
Scripting

Views

4.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 04, 2009 Aug 04, 2009

How about this Dynamic Duo?

//DESCRIPTION: One Layer Down

for (s=0; s<app.selection.length; s++)
{
if (app.selection.itemLayer.index < app.activeDocument.layers.length-1)
  app.selection.itemLayer = app.activeDocument.layers.nextItem(app.selection.itemLayer);
}

//DESCRIPTION: One Layer Up
for (s=0; s<app.selection.length; s++)
{
if (app.selection.itemLayer.index > 0)
  app.selection.itemLayer = app.activeDocument.layers.previousItem(app.selection.itemLayer);
}

It works, even with a multiple selection on dif

...

Votes

Translate

Translate
Community Expert ,
Aug 04, 2009 Aug 04, 2009

Copy link to clipboard

Copied

How about this Dynamic Duo?

//DESCRIPTION: One Layer Down

for (s=0; s<app.selection.length; s++)
{
if (app.selection.itemLayer.index < app.activeDocument.layers.length-1)
  app.selection.itemLayer = app.activeDocument.layers.nextItem(app.selection.itemLayer);
}

//DESCRIPTION: One Layer Up
for (s=0; s<app.selection.length; s++)
{
if (app.selection.itemLayer.index > 0)
  app.selection.itemLayer = app.activeDocument.layers.previousItem(app.selection.itemLayer);
}

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

Be warned that without the Layer panel open, you might not be aware of your current active layer! This changes as a selection is moved from one layer to another.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 04, 2009 Aug 04, 2009

Copy link to clipboard

Copied

Thanks very much Jongware,

I'll try this out and see how it goes. Do you know if its possible to tweak this so that it allow moving to a locked layer? The same way that holding the command key allows when dragging between layers? That way I could keep my destination layer (and any others) locked so as to isolate myself to one layer, the only unlocked one?

Could be a solution to pitfall you mention if it can be done...

Cheers,

Lewis

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 04, 2009 Aug 04, 2009

Copy link to clipboard

Copied

Thanks for your advice on this, it works a treat. In fact it actually allows you to move the object over to a locked layer (although not back out again).

I have the two scripts assigned to command-alt-up and command-alt-down and this will speed up my workflow immensely.

Thanks again.

Lewis

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 11, 2017 Oct 11, 2017

Copy link to clipboard

Copied

Hi.

I need to move an paragraph style to a layer. (Indesign CS6)

I found it an apple script (CS4):

  set myPstyle to paragraph style "CODES"

           -- if the page is a spread

           set x to properties of spread 1

         

           set LayerName to "PR"

           try

               set myLayer to layer LayerName

               set the properties of myLayer to {locked:false}

           on error

Is it possible in java script (or apple script CS6) that I can to build a list of styles moving to a 2 different layers all at once and every page?

Regards

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 17, 2022 Dec 17, 2022

Copy link to clipboard

Copied

Hello there!
Is there a way we can make this work for INDD 2023 ?
I've just tested it and it returns an error.... 😞 So sad.... I was really into improving my workflow with this!

 

Thanks for any help!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2022 Dec 17, 2022

Copy link to clipboard

Copied

Hi @Erik Lingerfelt , This thread is from 2009, and the post’s text has been corrupted—app.selection. needs to be app.selection[s]. Try these:

 

 

 

//DESCRIPTION: One Layer Down
for (s=0; s<app.selection.length; s++){
    if (app.selection[s].itemLayer.index < app.activeDocument.layers.length-1)
    app.selection[s].itemLayer = app.activeDocument.layers.nextItem(app.selection[s].itemLayer);
}

 

 

 

//DESCRIPTION: One Layer Up
for (s=0; s<app.selection.length; s++){
    if (app.selection[s].itemLayer.index > 0)
    app.selection[s].itemLayer = app.activeDocument.layers.previousItem(app.selection[s].itemLayer);
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 31, 2024 Jan 31, 2024

Copy link to clipboard

Copied

LATEST

Awesome!! Thanks for the update, that's exactly what I was looking for 😁

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 04, 2009 Aug 04, 2009

Copy link to clipboard

Copied

no way to beat [Jongware]

this toggles thru all layers.

Ralf


Message was edited by: liedzeit

I give up. Cannot insert code...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines